diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..3a253c45 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,26 @@ +.ruby: &ruby + variables: + LANG: "C.UTF-8" + before_script: + - ruby -v + - bundle config set --local deployment true + - bundle install -j $(nproc) + parallel: + matrix: + - RUBY_VERSION: ['2.7', '3.0', '3.1'] + image: "ruby:$RUBY_VERSION" + cache: + paths: + - vendor/ruby + key: 'ruby-$RUBY_VERSION' + +gem: + extends: .ruby + script: + - bundle exec rspec + - bundle exec rake build + - bundle exec rake install + artifacts: + paths: + - pkg/*.gem + diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 3a5d7974..c10a1b91 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,3 +1,4 @@ +.gitlab-ci.yml .rspec .rubocop.yml Gemfile @@ -5,152 +6,144 @@ README.md Rakefile docs/AccountRequest.md docs/AccountResult.md -docs/AccountResultAllOf.md docs/AccountStatus.md docs/AccountType.md docs/AddToConference.md -docs/AddToConferenceAllOf.md +docs/AddToConferenceNotificationWebhook.md +docs/AddToQueueNotificationWebhook.md docs/AnsweredBy.md docs/ApplicationList.md -docs/ApplicationListAllOf.md docs/ApplicationRequest.md docs/ApplicationResult.md -docs/ApplicationResultAllOf.md docs/AvailableNumber.md docs/AvailableNumberList.md -docs/AvailableNumberListAllOf.md +docs/BargeInReason.md docs/BuyIncomingNumberRequest.md +docs/CallControlWebhook.md docs/CallDirection.md +docs/CallEndedReason.md docs/CallList.md -docs/CallListAllOf.md docs/CallResult.md -docs/CallResultAllOf.md docs/CallStatus.md +docs/CallStatusWebhook.md docs/Capabilities.md docs/CompletionRequest.md docs/CompletionResult.md +docs/CompletionResultStatus.md docs/ConferenceList.md -docs/ConferenceListAllOf.md docs/ConferenceParticipantList.md -docs/ConferenceParticipantListAllOf.md docs/ConferenceParticipantResult.md -docs/ConferenceParticipantResultAllOf.md +docs/ConferenceRecordingStatusWebhook.md docs/ConferenceResult.md -docs/ConferenceResultAllOf.md docs/ConferenceStatus.md +docs/ConferenceStatusWebhook.md docs/CreateConference.md -docs/CreateConferenceAllOf.md docs/CreateConferenceRequest.md +docs/CreateConferenceWebhook.md docs/CreateWebRTCToken.md docs/DefaultApi.md docs/Dequeue.md +docs/DequeueWebhook.md docs/Enqueue.md -docs/EnqueueAllOf.md docs/FilterLogsRequest.md docs/GetDigits.md -docs/GetDigitsAllOf.md +docs/GetDigitsReason.md +docs/GetDigitsWebhook.md docs/GetSpeech.md -docs/GetSpeechAllOf.md docs/GetSpeechReason.md +docs/GetSpeechWebhook.md docs/GrammarFileBuiltIn.md docs/GrammarType.md docs/Hangup.md -docs/HangupAllOf.md docs/IfMachine.md +docs/InboundCallWebhook.md docs/IncomingNumberList.md -docs/IncomingNumberListAllOf.md docs/IncomingNumberRequest.md docs/IncomingNumberResult.md -docs/IncomingNumberResultAllOf.md docs/Language.md +docs/LeaveConferenceWebhook.md docs/LogLevel.md docs/LogList.md -docs/LogListAllOf.md docs/LogResult.md +docs/MachineDetectedWebhook.md docs/MachineType.md docs/MakeCallRequest.md +docs/MessageDeliveryWebhook.md docs/MessageDirection.md docs/MessageRequest.md -docs/MessageRequestAllOf.md docs/MessageResult.md -docs/MessageResultAllOf.md docs/MessageStatus.md +docs/MessageStatusWebhook.md docs/MessagesList.md -docs/MessagesListAllOf.md docs/MutableResourceModel.md docs/OutDial.md -docs/OutDialAllOf.md +docs/OutDialApiConnectWebhook.md +docs/OutDialConnectWebhook.md +docs/OutDialStartWebhook.md docs/PaginationModel.md docs/Park.md -docs/ParkAllOf.md docs/Pause.md -docs/PauseAllOf.md docs/PerclCommand.md docs/PerclScript.md docs/Play.md -docs/PlayAllOf.md docs/PlayBeep.md docs/PlayEarlyMedia.md -docs/PlayEarlyMediaAllOf.md docs/QueueList.md -docs/QueueListAllOf.md docs/QueueMember.md docs/QueueMemberList.md -docs/QueueMemberListAllOf.md docs/QueueRequest.md docs/QueueResult.md -docs/QueueResultAllOf.md docs/QueueResultStatus.md +docs/QueueWaitWebhook.md docs/RecordUtterance.md -docs/RecordUtteranceAllOf.md docs/RecordUtteranceTermReason.md +docs/RecordWebhook.md docs/RecordingList.md -docs/RecordingListAllOf.md docs/RecordingResult.md -docs/RecordingResultAllOf.md docs/Redirect.md -docs/RedirectAllOf.md +docs/RedirectWebhook.md docs/Reject.md -docs/RejectAllOf.md docs/RemoveFromConference.md +docs/RemoveFromQueueNotificationWebhook.md docs/RequestType.md docs/SMSTenDLCBrand.md +docs/SMSTenDLCBrandAltBusinessIdType.md +docs/SMSTenDLCBrandEntityType.md +docs/SMSTenDLCBrandIdentityStatus.md +docs/SMSTenDLCBrandRelationship.md +docs/SMSTenDLCBrandStockExchange.md docs/SMSTenDLCBrandsListResult.md -docs/SMSTenDLCBrandsListResultAllOf.md docs/SMSTenDLCCampaign.md +docs/SMSTenDLCCampaignStatus.md docs/SMSTenDLCCampaignsListResult.md -docs/SMSTenDLCCampaignsListResultAllOf.md docs/SMSTenDLCPartnerCampaign.md docs/SMSTenDLCPartnerCampaignBrand.md +docs/SMSTenDLCPartnerCampaignStatus.md docs/SMSTenDLCPartnerCampaignsListResult.md -docs/SMSTenDLCPartnerCampaignsListResultAllOf.md docs/SMSTollFreeCampaign.md +docs/SMSTollFreeCampaignRegistrationStatus.md docs/SMSTollFreeCampaignsListResult.md -docs/SMSTollFreeCampaignsListResultAllOf.md docs/Say.md -docs/SayAllOf.md docs/SendDigits.md -docs/SendDigitsAllOf.md docs/SetDTMFPassThrough.md -docs/SetDTMFPassThroughAllOf.md docs/SetListen.md -docs/SetListenAllOf.md docs/SetTalk.md -docs/SetTalkAllOf.md docs/Sms.md -docs/SmsAllOf.md docs/StartRecordCall.md docs/TFN.md docs/TerminateConference.md +docs/TranscribeReason.md +docs/TranscribeTermReason.md docs/TranscribeUtterance.md -docs/TranscribeUtteranceAllOf.md -docs/TranscribeUtteranceAllOfRecord.md +docs/TranscribeUtteranceRecord.md +docs/TranscribeWebhook.md docs/Unpark.md docs/UpdateCallRequest.md docs/UpdateCallRequestStatus.md docs/UpdateConferenceParticipantRequest.md docs/UpdateConferenceRequest.md docs/UpdateConferenceRequestStatus.md +docs/Webhook.md freeclimb.gemspec lib/freeclimb.rb lib/freeclimb/api/default_api.rb @@ -159,153 +152,282 @@ lib/freeclimb/api_error.rb lib/freeclimb/configuration.rb lib/freeclimb/models/account_request.rb lib/freeclimb/models/account_result.rb -lib/freeclimb/models/account_result_all_of.rb lib/freeclimb/models/account_status.rb lib/freeclimb/models/account_type.rb lib/freeclimb/models/add_to_conference.rb -lib/freeclimb/models/add_to_conference_all_of.rb +lib/freeclimb/models/add_to_conference_notification_webhook.rb +lib/freeclimb/models/add_to_queue_notification_webhook.rb lib/freeclimb/models/answered_by.rb lib/freeclimb/models/application_list.rb -lib/freeclimb/models/application_list_all_of.rb lib/freeclimb/models/application_request.rb lib/freeclimb/models/application_result.rb -lib/freeclimb/models/application_result_all_of.rb lib/freeclimb/models/available_number.rb lib/freeclimb/models/available_number_list.rb -lib/freeclimb/models/available_number_list_all_of.rb +lib/freeclimb/models/barge_in_reason.rb lib/freeclimb/models/buy_incoming_number_request.rb +lib/freeclimb/models/call_control_webhook.rb lib/freeclimb/models/call_direction.rb +lib/freeclimb/models/call_ended_reason.rb lib/freeclimb/models/call_list.rb -lib/freeclimb/models/call_list_all_of.rb lib/freeclimb/models/call_result.rb -lib/freeclimb/models/call_result_all_of.rb lib/freeclimb/models/call_status.rb +lib/freeclimb/models/call_status_webhook.rb lib/freeclimb/models/capabilities.rb lib/freeclimb/models/completion_request.rb lib/freeclimb/models/completion_result.rb +lib/freeclimb/models/completion_result_status.rb lib/freeclimb/models/conference_list.rb -lib/freeclimb/models/conference_list_all_of.rb lib/freeclimb/models/conference_participant_list.rb -lib/freeclimb/models/conference_participant_list_all_of.rb lib/freeclimb/models/conference_participant_result.rb -lib/freeclimb/models/conference_participant_result_all_of.rb +lib/freeclimb/models/conference_recording_status_webhook.rb lib/freeclimb/models/conference_result.rb -lib/freeclimb/models/conference_result_all_of.rb lib/freeclimb/models/conference_status.rb +lib/freeclimb/models/conference_status_webhook.rb lib/freeclimb/models/create_conference.rb -lib/freeclimb/models/create_conference_all_of.rb lib/freeclimb/models/create_conference_request.rb +lib/freeclimb/models/create_conference_webhook.rb lib/freeclimb/models/create_web_rtc_token.rb lib/freeclimb/models/dequeue.rb +lib/freeclimb/models/dequeue_webhook.rb lib/freeclimb/models/enqueue.rb -lib/freeclimb/models/enqueue_all_of.rb lib/freeclimb/models/filter_logs_request.rb lib/freeclimb/models/get_digits.rb -lib/freeclimb/models/get_digits_all_of.rb +lib/freeclimb/models/get_digits_reason.rb +lib/freeclimb/models/get_digits_webhook.rb lib/freeclimb/models/get_speech.rb -lib/freeclimb/models/get_speech_all_of.rb lib/freeclimb/models/get_speech_reason.rb +lib/freeclimb/models/get_speech_webhook.rb lib/freeclimb/models/grammar_file_built_in.rb lib/freeclimb/models/grammar_type.rb lib/freeclimb/models/hangup.rb -lib/freeclimb/models/hangup_all_of.rb lib/freeclimb/models/if_machine.rb +lib/freeclimb/models/inbound_call_webhook.rb lib/freeclimb/models/incoming_number_list.rb -lib/freeclimb/models/incoming_number_list_all_of.rb lib/freeclimb/models/incoming_number_request.rb lib/freeclimb/models/incoming_number_result.rb -lib/freeclimb/models/incoming_number_result_all_of.rb lib/freeclimb/models/language.rb +lib/freeclimb/models/leave_conference_webhook.rb lib/freeclimb/models/log_level.rb lib/freeclimb/models/log_list.rb -lib/freeclimb/models/log_list_all_of.rb lib/freeclimb/models/log_result.rb +lib/freeclimb/models/machine_detected_webhook.rb lib/freeclimb/models/machine_type.rb lib/freeclimb/models/make_call_request.rb +lib/freeclimb/models/message_delivery_webhook.rb lib/freeclimb/models/message_direction.rb lib/freeclimb/models/message_request.rb -lib/freeclimb/models/message_request_all_of.rb lib/freeclimb/models/message_result.rb -lib/freeclimb/models/message_result_all_of.rb lib/freeclimb/models/message_status.rb +lib/freeclimb/models/message_status_webhook.rb lib/freeclimb/models/messages_list.rb -lib/freeclimb/models/messages_list_all_of.rb lib/freeclimb/models/mutable_resource_model.rb lib/freeclimb/models/out_dial.rb -lib/freeclimb/models/out_dial_all_of.rb +lib/freeclimb/models/out_dial_api_connect_webhook.rb +lib/freeclimb/models/out_dial_connect_webhook.rb +lib/freeclimb/models/out_dial_start_webhook.rb lib/freeclimb/models/pagination_model.rb lib/freeclimb/models/park.rb -lib/freeclimb/models/park_all_of.rb lib/freeclimb/models/pause.rb -lib/freeclimb/models/pause_all_of.rb lib/freeclimb/models/percl_command.rb lib/freeclimb/models/percl_script.rb lib/freeclimb/models/play.rb -lib/freeclimb/models/play_all_of.rb lib/freeclimb/models/play_beep.rb lib/freeclimb/models/play_early_media.rb -lib/freeclimb/models/play_early_media_all_of.rb lib/freeclimb/models/queue_list.rb -lib/freeclimb/models/queue_list_all_of.rb lib/freeclimb/models/queue_member.rb lib/freeclimb/models/queue_member_list.rb -lib/freeclimb/models/queue_member_list_all_of.rb lib/freeclimb/models/queue_request.rb lib/freeclimb/models/queue_result.rb -lib/freeclimb/models/queue_result_all_of.rb lib/freeclimb/models/queue_result_status.rb +lib/freeclimb/models/queue_wait_webhook.rb lib/freeclimb/models/record_utterance.rb -lib/freeclimb/models/record_utterance_all_of.rb lib/freeclimb/models/record_utterance_term_reason.rb +lib/freeclimb/models/record_webhook.rb lib/freeclimb/models/recording_list.rb -lib/freeclimb/models/recording_list_all_of.rb lib/freeclimb/models/recording_result.rb -lib/freeclimb/models/recording_result_all_of.rb lib/freeclimb/models/redirect.rb -lib/freeclimb/models/redirect_all_of.rb +lib/freeclimb/models/redirect_webhook.rb lib/freeclimb/models/reject.rb -lib/freeclimb/models/reject_all_of.rb lib/freeclimb/models/remove_from_conference.rb +lib/freeclimb/models/remove_from_queue_notification_webhook.rb lib/freeclimb/models/request_type.rb lib/freeclimb/models/say.rb -lib/freeclimb/models/say_all_of.rb lib/freeclimb/models/send_digits.rb -lib/freeclimb/models/send_digits_all_of.rb lib/freeclimb/models/set_dtmf_pass_through.rb -lib/freeclimb/models/set_dtmf_pass_through_all_of.rb lib/freeclimb/models/set_listen.rb -lib/freeclimb/models/set_listen_all_of.rb lib/freeclimb/models/set_talk.rb -lib/freeclimb/models/set_talk_all_of.rb lib/freeclimb/models/sms.rb -lib/freeclimb/models/sms_all_of.rb lib/freeclimb/models/sms_ten_dlc_brand.rb +lib/freeclimb/models/sms_ten_dlc_brand_alt_business_id_type.rb +lib/freeclimb/models/sms_ten_dlc_brand_entity_type.rb +lib/freeclimb/models/sms_ten_dlc_brand_identity_status.rb +lib/freeclimb/models/sms_ten_dlc_brand_relationship.rb +lib/freeclimb/models/sms_ten_dlc_brand_stock_exchange.rb lib/freeclimb/models/sms_ten_dlc_brands_list_result.rb -lib/freeclimb/models/sms_ten_dlc_brands_list_result_all_of.rb lib/freeclimb/models/sms_ten_dlc_campaign.rb +lib/freeclimb/models/sms_ten_dlc_campaign_status.rb lib/freeclimb/models/sms_ten_dlc_campaigns_list_result.rb -lib/freeclimb/models/sms_ten_dlc_campaigns_list_result_all_of.rb lib/freeclimb/models/sms_ten_dlc_partner_campaign.rb lib/freeclimb/models/sms_ten_dlc_partner_campaign_brand.rb +lib/freeclimb/models/sms_ten_dlc_partner_campaign_status.rb lib/freeclimb/models/sms_ten_dlc_partner_campaigns_list_result.rb -lib/freeclimb/models/sms_ten_dlc_partner_campaigns_list_result_all_of.rb lib/freeclimb/models/sms_toll_free_campaign.rb +lib/freeclimb/models/sms_toll_free_campaign_registration_status.rb lib/freeclimb/models/sms_toll_free_campaigns_list_result.rb -lib/freeclimb/models/sms_toll_free_campaigns_list_result_all_of.rb lib/freeclimb/models/start_record_call.rb lib/freeclimb/models/terminate_conference.rb lib/freeclimb/models/tfn.rb +lib/freeclimb/models/transcribe_reason.rb +lib/freeclimb/models/transcribe_term_reason.rb lib/freeclimb/models/transcribe_utterance.rb -lib/freeclimb/models/transcribe_utterance_all_of.rb -lib/freeclimb/models/transcribe_utterance_all_of_record.rb +lib/freeclimb/models/transcribe_utterance_record.rb +lib/freeclimb/models/transcribe_webhook.rb lib/freeclimb/models/unpark.rb lib/freeclimb/models/update_call_request.rb lib/freeclimb/models/update_call_request_status.rb lib/freeclimb/models/update_conference_participant_request.rb lib/freeclimb/models/update_conference_request.rb lib/freeclimb/models/update_conference_request_status.rb +lib/freeclimb/models/webhook.rb lib/freeclimb/version.rb -spec/api_client_spec.rb -spec/configuration_spec.rb +spec/api/default_api_spec.rb +spec/models/account_request_spec.rb +spec/models/account_result_spec.rb +spec/models/account_status_spec.rb +spec/models/account_type_spec.rb +spec/models/add_to_conference_notification_webhook_spec.rb +spec/models/add_to_conference_spec.rb +spec/models/add_to_queue_notification_webhook_spec.rb +spec/models/answered_by_spec.rb +spec/models/application_list_spec.rb +spec/models/application_request_spec.rb +spec/models/application_result_spec.rb +spec/models/available_number_list_spec.rb +spec/models/available_number_spec.rb +spec/models/barge_in_reason_spec.rb +spec/models/buy_incoming_number_request_spec.rb +spec/models/call_control_webhook_spec.rb +spec/models/call_direction_spec.rb +spec/models/call_ended_reason_spec.rb +spec/models/call_list_spec.rb +spec/models/call_result_spec.rb +spec/models/call_status_spec.rb +spec/models/call_status_webhook_spec.rb +spec/models/capabilities_spec.rb +spec/models/completion_request_spec.rb +spec/models/completion_result_spec.rb +spec/models/completion_result_status_spec.rb +spec/models/conference_list_spec.rb +spec/models/conference_participant_list_spec.rb +spec/models/conference_participant_result_spec.rb +spec/models/conference_recording_status_webhook_spec.rb +spec/models/conference_result_spec.rb +spec/models/conference_status_spec.rb +spec/models/conference_status_webhook_spec.rb +spec/models/create_conference_request_spec.rb +spec/models/create_conference_spec.rb +spec/models/create_conference_webhook_spec.rb +spec/models/create_web_rtc_token_spec.rb +spec/models/dequeue_spec.rb +spec/models/dequeue_webhook_spec.rb +spec/models/enqueue_spec.rb +spec/models/filter_logs_request_spec.rb +spec/models/get_digits_reason_spec.rb +spec/models/get_digits_spec.rb +spec/models/get_digits_webhook_spec.rb +spec/models/get_speech_reason_spec.rb +spec/models/get_speech_spec.rb +spec/models/get_speech_webhook_spec.rb +spec/models/grammar_file_built_in_spec.rb +spec/models/grammar_type_spec.rb +spec/models/hangup_spec.rb +spec/models/if_machine_spec.rb +spec/models/inbound_call_webhook_spec.rb +spec/models/incoming_number_list_spec.rb +spec/models/incoming_number_request_spec.rb +spec/models/incoming_number_result_spec.rb +spec/models/language_spec.rb +spec/models/leave_conference_webhook_spec.rb +spec/models/log_level_spec.rb +spec/models/log_list_spec.rb +spec/models/log_result_spec.rb +spec/models/machine_detected_webhook_spec.rb +spec/models/machine_type_spec.rb +spec/models/make_call_request_spec.rb +spec/models/message_delivery_webhook_spec.rb +spec/models/message_direction_spec.rb +spec/models/message_request_spec.rb +spec/models/message_result_spec.rb +spec/models/message_status_spec.rb +spec/models/message_status_webhook_spec.rb +spec/models/messages_list_spec.rb +spec/models/mutable_resource_model_spec.rb +spec/models/out_dial_api_connect_webhook_spec.rb +spec/models/out_dial_connect_webhook_spec.rb +spec/models/out_dial_spec.rb +spec/models/out_dial_start_webhook_spec.rb +spec/models/pagination_model_spec.rb +spec/models/park_spec.rb +spec/models/pause_spec.rb +spec/models/percl_command_spec.rb +spec/models/percl_script_spec.rb +spec/models/play_beep_spec.rb +spec/models/play_early_media_spec.rb +spec/models/play_spec.rb +spec/models/queue_list_spec.rb +spec/models/queue_member_list_spec.rb +spec/models/queue_member_spec.rb +spec/models/queue_request_spec.rb +spec/models/queue_result_spec.rb +spec/models/queue_result_status_spec.rb +spec/models/queue_wait_webhook_spec.rb +spec/models/record_utterance_spec.rb +spec/models/record_utterance_term_reason_spec.rb +spec/models/record_webhook_spec.rb +spec/models/recording_list_spec.rb +spec/models/recording_result_spec.rb +spec/models/redirect_spec.rb +spec/models/redirect_webhook_spec.rb +spec/models/reject_spec.rb +spec/models/remove_from_conference_spec.rb +spec/models/remove_from_queue_notification_webhook_spec.rb +spec/models/request_type_spec.rb +spec/models/say_spec.rb +spec/models/send_digits_spec.rb spec/models/set_dtmf_pass_through_spec.rb +spec/models/set_listen_spec.rb +spec/models/set_talk_spec.rb +spec/models/sms_spec.rb +spec/models/sms_ten_dlc_brand_alt_business_id_type_spec.rb +spec/models/sms_ten_dlc_brand_entity_type_spec.rb +spec/models/sms_ten_dlc_brand_identity_status_spec.rb +spec/models/sms_ten_dlc_brand_relationship_spec.rb +spec/models/sms_ten_dlc_brand_spec.rb +spec/models/sms_ten_dlc_brand_stock_exchange_spec.rb +spec/models/sms_ten_dlc_brands_list_result_spec.rb +spec/models/sms_ten_dlc_campaign_spec.rb +spec/models/sms_ten_dlc_campaign_status_spec.rb +spec/models/sms_ten_dlc_campaigns_list_result_spec.rb +spec/models/sms_ten_dlc_partner_campaign_brand_spec.rb +spec/models/sms_ten_dlc_partner_campaign_spec.rb +spec/models/sms_ten_dlc_partner_campaign_status_spec.rb +spec/models/sms_ten_dlc_partner_campaigns_list_result_spec.rb +spec/models/sms_toll_free_campaign_registration_status_spec.rb +spec/models/sms_toll_free_campaign_spec.rb +spec/models/sms_toll_free_campaigns_list_result_spec.rb +spec/models/start_record_call_spec.rb +spec/models/terminate_conference_spec.rb +spec/models/tfn_spec.rb +spec/models/transcribe_reason_spec.rb +spec/models/transcribe_term_reason_spec.rb +spec/models/transcribe_utterance_record_spec.rb +spec/models/transcribe_utterance_spec.rb +spec/models/transcribe_webhook_spec.rb +spec/models/unpark_spec.rb +spec/models/update_call_request_spec.rb +spec/models/update_call_request_status_spec.rb +spec/models/update_conference_participant_request_spec.rb +spec/models/update_conference_request_spec.rb +spec/models/update_conference_request_status_spec.rb +spec/models/webhook_spec.rb spec/spec_helper.rb diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 1e20ec35..4bc5d618 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -5.4.0 \ No newline at end of file +7.9.0 diff --git a/.rubocop.yml b/.rubocop.yml index d32b2b1c..6acbeaf4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -40,9 +40,6 @@ Layout/EmptyLinesAroundMethodBody: Layout/EmptyLinesAroundModuleBody: Enabled: true -Layout/FirstArgumentIndentation: - Enabled: true - # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. Style/HashSyntax: Enabled: false @@ -51,7 +48,7 @@ Style/HashSyntax: # extra level of indentation. Layout/IndentationConsistency: Enabled: true - EnforcedStyle: indented_internal_methods + EnforcedStyle: normal # Two spaces, no tabs (for indentation). Layout/IndentationWidth: @@ -112,22 +109,10 @@ Layout/SpaceInsideParens: # Enabled: true # EnforcedStyle: single_quotes -# Detect hard tabs, no hard tabs. -Layout/IndentationStyle: - Enabled: true - -# Blank lines should not have any spaces. -Layout/TrailingEmptyLines: - Enabled: true - # No trailing whitespace. Layout/TrailingWhitespace: Enabled: false -# Use quotes for string literals when they are enough. -Style/RedundantPercentQ: - Enabled: true - # Align `end` with the matching keyword or starting expression except for # assignments, where it should be aligned with the LHS. Layout/EndAlignment: diff --git a/CHANGELOG.md b/CHANGELOG.md index cbf8c343..5a06c920 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,20 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm None + + +## [5.0.0] - 2025-01-08 + +### Added +- Webhook classes +- More idiomated Enum management + +### Changed +- Use upgraded openapi generator + +### Removed +- *AllOf model files + ## [4.9.0] - 2024-12-17 diff --git a/Gemfile.lock b/Gemfile.lock index 67614f91..7b1a4c40 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,34 +1,39 @@ PATH remote: . specs: - freeclimb (4.8.0) + freeclimb (5.0.0) typhoeus (~> 1.0, >= 1.0.1) GEM remote: https://rubygems.org/ specs: - activesupport (7.1.4.1) + activesupport (8.0.1) base64 + benchmark (>= 0.3) bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) base64 (0.2.0) - bigdecimal (3.1.8) + benchmark (0.4.0) + bigdecimal (3.1.9) byebug (11.1.3) coderay (1.1.3) concurrent-ruby (1.3.4) - connection_pool (2.4.1) + connection_pool (2.5.0) crack (1.0.0) bigdecimal rexml + date (3.4.1) diff-lcs (1.5.1) drb (2.2.1) ethon (0.16.0) @@ -36,16 +41,26 @@ GEM facets (3.1.0) factory_bot (6.5.0) activesupport (>= 5.0.0) - ffi (1.17.0-arm64-darwin) - hashdiff (1.1.1) + ffi (1.17.1) + ffi (1.17.1-aarch64-linux-gnu) + ffi (1.17.1-aarch64-linux-musl) + ffi (1.17.1-arm-linux-gnu) + ffi (1.17.1-arm-linux-musl) + ffi (1.17.1-arm64-darwin) + ffi (1.17.1-x86-linux-gnu) + ffi (1.17.1-x86-linux-musl) + ffi (1.17.1-x86_64-darwin) + ffi (1.17.1-x86_64-linux-gnu) + ffi (1.17.1-x86_64-linux-musl) + hashdiff (1.1.2) i18n (1.14.6) concurrent-ruby (~> 1.0) jaro_winkler (1.5.6) + logger (1.6.4) method_source (1.1.0) - minitest (5.25.1) - mutex_m (0.2.0) + minitest (5.25.4) parallel (1.26.3) - parser (3.3.5.0) + parser (3.3.6.0) ast (~> 2.4.1) racc pry (0.14.2) @@ -54,18 +69,19 @@ GEM pry-byebug (3.10.1) byebug (~> 11.0) pry (>= 0.13, < 0.15) - psych (5.1.2) + psych (5.2.2) + date stringio public_suffix (6.0.1) racc (1.8.1) rainbow (3.1.1) rake (13.0.6) - rexml (3.3.8) + rexml (3.4.0) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.1) + rspec-core (3.13.2) rspec-support (~> 3.13.0) rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) @@ -73,7 +89,7 @@ GEM rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-support (3.13.1) + rspec-support (3.13.2) rubocop (0.66.0) jaro_winkler (~> 1.5.1) parallel (~> 1.10) @@ -83,19 +99,31 @@ GEM ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 1.6) ruby-progressbar (1.13.0) - stringio (3.1.1) + securerandom (0.4.1) + stringio (3.1.2) typhoeus (1.4.1) ethon (>= 0.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (1.5.0) + uri (1.0.2) webmock (3.24.0) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) PLATFORMS + aarch64-linux-gnu + aarch64-linux-musl + arm-linux-gnu + arm-linux-musl + arm64-darwin ruby + x86-linux-gnu + x86-linux-musl + x86_64-darwin + x86_64-linux-gnu + x86_64-linux-musl DEPENDENCIES facets (~> 3.1) @@ -108,4 +136,4 @@ DEPENDENCIES webmock (~> 3.14) BUNDLED WITH - 2.3.6 + 2.5.16 diff --git a/README.md b/README.md index 8409cf60..0974d4ee 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ FreeClimb is a cloud-based application programming interface (API) that puts the This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.0.0 -- Package version: 4.9.0 +- Package version: 5.0.0 - Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit [https://www.freeclimb.com/support/](https://www.freeclimb.com/support/) @@ -15,7 +15,7 @@ For more information, please visit [https://www.freeclimb.com/support/](https:// Add this to the Gemfile: - gem 'freeclimb', '~> 4.9.0' + gem 'freeclimb', '~> 5.0.0' and run from your terminal @@ -44,9 +44,9 @@ gem build freeclimb.gemspec Then either install the gem locally: ```shell -gem install ./freeclimb-4.9.0.gem +gem install ./freeclimb-5.0.0.gem ``` -(for development, run `gem install --dev ./freeclimb-4.9.0.gem` to install the development dependencies) +(for development, run `gem install --dev ./freeclimb-5.0.0.gem` to install the development dependencies) ## Getting Started @@ -162,151 +162,143 @@ Class | Method | HTTP request | Description - [Freeclimb::AccountRequest](docs/AccountRequest.md) - [Freeclimb::AccountResult](docs/AccountResult.md) - - [Freeclimb::AccountResultAllOf](docs/AccountResultAllOf.md) - [Freeclimb::AccountStatus](docs/AccountStatus.md) - [Freeclimb::AccountType](docs/AccountType.md) - [Freeclimb::AddToConference](docs/AddToConference.md) - - [Freeclimb::AddToConferenceAllOf](docs/AddToConferenceAllOf.md) + - [Freeclimb::AddToConferenceNotificationWebhook](docs/AddToConferenceNotificationWebhook.md) + - [Freeclimb::AddToQueueNotificationWebhook](docs/AddToQueueNotificationWebhook.md) - [Freeclimb::AnsweredBy](docs/AnsweredBy.md) - [Freeclimb::ApplicationList](docs/ApplicationList.md) - - [Freeclimb::ApplicationListAllOf](docs/ApplicationListAllOf.md) - [Freeclimb::ApplicationRequest](docs/ApplicationRequest.md) - [Freeclimb::ApplicationResult](docs/ApplicationResult.md) - - [Freeclimb::ApplicationResultAllOf](docs/ApplicationResultAllOf.md) - [Freeclimb::AvailableNumber](docs/AvailableNumber.md) - [Freeclimb::AvailableNumberList](docs/AvailableNumberList.md) - - [Freeclimb::AvailableNumberListAllOf](docs/AvailableNumberListAllOf.md) + - [Freeclimb::BargeInReason](docs/BargeInReason.md) - [Freeclimb::BuyIncomingNumberRequest](docs/BuyIncomingNumberRequest.md) + - [Freeclimb::CallControlWebhook](docs/CallControlWebhook.md) - [Freeclimb::CallDirection](docs/CallDirection.md) + - [Freeclimb::CallEndedReason](docs/CallEndedReason.md) - [Freeclimb::CallList](docs/CallList.md) - - [Freeclimb::CallListAllOf](docs/CallListAllOf.md) - [Freeclimb::CallResult](docs/CallResult.md) - - [Freeclimb::CallResultAllOf](docs/CallResultAllOf.md) - [Freeclimb::CallStatus](docs/CallStatus.md) + - [Freeclimb::CallStatusWebhook](docs/CallStatusWebhook.md) - [Freeclimb::Capabilities](docs/Capabilities.md) - [Freeclimb::CompletionRequest](docs/CompletionRequest.md) - [Freeclimb::CompletionResult](docs/CompletionResult.md) + - [Freeclimb::CompletionResultStatus](docs/CompletionResultStatus.md) - [Freeclimb::ConferenceList](docs/ConferenceList.md) - - [Freeclimb::ConferenceListAllOf](docs/ConferenceListAllOf.md) - [Freeclimb::ConferenceParticipantList](docs/ConferenceParticipantList.md) - - [Freeclimb::ConferenceParticipantListAllOf](docs/ConferenceParticipantListAllOf.md) - [Freeclimb::ConferenceParticipantResult](docs/ConferenceParticipantResult.md) - - [Freeclimb::ConferenceParticipantResultAllOf](docs/ConferenceParticipantResultAllOf.md) + - [Freeclimb::ConferenceRecordingStatusWebhook](docs/ConferenceRecordingStatusWebhook.md) - [Freeclimb::ConferenceResult](docs/ConferenceResult.md) - - [Freeclimb::ConferenceResultAllOf](docs/ConferenceResultAllOf.md) - [Freeclimb::ConferenceStatus](docs/ConferenceStatus.md) + - [Freeclimb::ConferenceStatusWebhook](docs/ConferenceStatusWebhook.md) - [Freeclimb::CreateConference](docs/CreateConference.md) - - [Freeclimb::CreateConferenceAllOf](docs/CreateConferenceAllOf.md) - [Freeclimb::CreateConferenceRequest](docs/CreateConferenceRequest.md) + - [Freeclimb::CreateConferenceWebhook](docs/CreateConferenceWebhook.md) - [Freeclimb::CreateWebRTCToken](docs/CreateWebRTCToken.md) - [Freeclimb::Dequeue](docs/Dequeue.md) + - [Freeclimb::DequeueWebhook](docs/DequeueWebhook.md) - [Freeclimb::Enqueue](docs/Enqueue.md) - - [Freeclimb::EnqueueAllOf](docs/EnqueueAllOf.md) - [Freeclimb::FilterLogsRequest](docs/FilterLogsRequest.md) - [Freeclimb::GetDigits](docs/GetDigits.md) - - [Freeclimb::GetDigitsAllOf](docs/GetDigitsAllOf.md) + - [Freeclimb::GetDigitsReason](docs/GetDigitsReason.md) + - [Freeclimb::GetDigitsWebhook](docs/GetDigitsWebhook.md) - [Freeclimb::GetSpeech](docs/GetSpeech.md) - - [Freeclimb::GetSpeechAllOf](docs/GetSpeechAllOf.md) - [Freeclimb::GetSpeechReason](docs/GetSpeechReason.md) + - [Freeclimb::GetSpeechWebhook](docs/GetSpeechWebhook.md) - [Freeclimb::GrammarFileBuiltIn](docs/GrammarFileBuiltIn.md) - [Freeclimb::GrammarType](docs/GrammarType.md) - [Freeclimb::Hangup](docs/Hangup.md) - - [Freeclimb::HangupAllOf](docs/HangupAllOf.md) - [Freeclimb::IfMachine](docs/IfMachine.md) + - [Freeclimb::InboundCallWebhook](docs/InboundCallWebhook.md) - [Freeclimb::IncomingNumberList](docs/IncomingNumberList.md) - - [Freeclimb::IncomingNumberListAllOf](docs/IncomingNumberListAllOf.md) - [Freeclimb::IncomingNumberRequest](docs/IncomingNumberRequest.md) - [Freeclimb::IncomingNumberResult](docs/IncomingNumberResult.md) - - [Freeclimb::IncomingNumberResultAllOf](docs/IncomingNumberResultAllOf.md) - [Freeclimb::Language](docs/Language.md) + - [Freeclimb::LeaveConferenceWebhook](docs/LeaveConferenceWebhook.md) - [Freeclimb::LogLevel](docs/LogLevel.md) - [Freeclimb::LogList](docs/LogList.md) - - [Freeclimb::LogListAllOf](docs/LogListAllOf.md) - [Freeclimb::LogResult](docs/LogResult.md) + - [Freeclimb::MachineDetectedWebhook](docs/MachineDetectedWebhook.md) - [Freeclimb::MachineType](docs/MachineType.md) - [Freeclimb::MakeCallRequest](docs/MakeCallRequest.md) + - [Freeclimb::MessageDeliveryWebhook](docs/MessageDeliveryWebhook.md) - [Freeclimb::MessageDirection](docs/MessageDirection.md) - [Freeclimb::MessageRequest](docs/MessageRequest.md) - - [Freeclimb::MessageRequestAllOf](docs/MessageRequestAllOf.md) - [Freeclimb::MessageResult](docs/MessageResult.md) - - [Freeclimb::MessageResultAllOf](docs/MessageResultAllOf.md) - [Freeclimb::MessageStatus](docs/MessageStatus.md) + - [Freeclimb::MessageStatusWebhook](docs/MessageStatusWebhook.md) - [Freeclimb::MessagesList](docs/MessagesList.md) - - [Freeclimb::MessagesListAllOf](docs/MessagesListAllOf.md) - [Freeclimb::MutableResourceModel](docs/MutableResourceModel.md) - [Freeclimb::OutDial](docs/OutDial.md) - - [Freeclimb::OutDialAllOf](docs/OutDialAllOf.md) + - [Freeclimb::OutDialApiConnectWebhook](docs/OutDialApiConnectWebhook.md) + - [Freeclimb::OutDialConnectWebhook](docs/OutDialConnectWebhook.md) + - [Freeclimb::OutDialStartWebhook](docs/OutDialStartWebhook.md) - [Freeclimb::PaginationModel](docs/PaginationModel.md) - [Freeclimb::Park](docs/Park.md) - - [Freeclimb::ParkAllOf](docs/ParkAllOf.md) - [Freeclimb::Pause](docs/Pause.md) - - [Freeclimb::PauseAllOf](docs/PauseAllOf.md) - [Freeclimb::PerclCommand](docs/PerclCommand.md) - [Freeclimb::PerclScript](docs/PerclScript.md) - [Freeclimb::Play](docs/Play.md) - - [Freeclimb::PlayAllOf](docs/PlayAllOf.md) - [Freeclimb::PlayBeep](docs/PlayBeep.md) - [Freeclimb::PlayEarlyMedia](docs/PlayEarlyMedia.md) - - [Freeclimb::PlayEarlyMediaAllOf](docs/PlayEarlyMediaAllOf.md) - [Freeclimb::QueueList](docs/QueueList.md) - - [Freeclimb::QueueListAllOf](docs/QueueListAllOf.md) - [Freeclimb::QueueMember](docs/QueueMember.md) - [Freeclimb::QueueMemberList](docs/QueueMemberList.md) - - [Freeclimb::QueueMemberListAllOf](docs/QueueMemberListAllOf.md) - [Freeclimb::QueueRequest](docs/QueueRequest.md) - [Freeclimb::QueueResult](docs/QueueResult.md) - - [Freeclimb::QueueResultAllOf](docs/QueueResultAllOf.md) - [Freeclimb::QueueResultStatus](docs/QueueResultStatus.md) + - [Freeclimb::QueueWaitWebhook](docs/QueueWaitWebhook.md) - [Freeclimb::RecordUtterance](docs/RecordUtterance.md) - - [Freeclimb::RecordUtteranceAllOf](docs/RecordUtteranceAllOf.md) - [Freeclimb::RecordUtteranceTermReason](docs/RecordUtteranceTermReason.md) + - [Freeclimb::RecordWebhook](docs/RecordWebhook.md) - [Freeclimb::RecordingList](docs/RecordingList.md) - - [Freeclimb::RecordingListAllOf](docs/RecordingListAllOf.md) - [Freeclimb::RecordingResult](docs/RecordingResult.md) - - [Freeclimb::RecordingResultAllOf](docs/RecordingResultAllOf.md) - [Freeclimb::Redirect](docs/Redirect.md) - - [Freeclimb::RedirectAllOf](docs/RedirectAllOf.md) + - [Freeclimb::RedirectWebhook](docs/RedirectWebhook.md) - [Freeclimb::Reject](docs/Reject.md) - - [Freeclimb::RejectAllOf](docs/RejectAllOf.md) - [Freeclimb::RemoveFromConference](docs/RemoveFromConference.md) + - [Freeclimb::RemoveFromQueueNotificationWebhook](docs/RemoveFromQueueNotificationWebhook.md) - [Freeclimb::RequestType](docs/RequestType.md) - [Freeclimb::SMSTenDLCBrand](docs/SMSTenDLCBrand.md) + - [Freeclimb::SMSTenDLCBrandAltBusinessIdType](docs/SMSTenDLCBrandAltBusinessIdType.md) + - [Freeclimb::SMSTenDLCBrandEntityType](docs/SMSTenDLCBrandEntityType.md) + - [Freeclimb::SMSTenDLCBrandIdentityStatus](docs/SMSTenDLCBrandIdentityStatus.md) + - [Freeclimb::SMSTenDLCBrandRelationship](docs/SMSTenDLCBrandRelationship.md) + - [Freeclimb::SMSTenDLCBrandStockExchange](docs/SMSTenDLCBrandStockExchange.md) - [Freeclimb::SMSTenDLCBrandsListResult](docs/SMSTenDLCBrandsListResult.md) - - [Freeclimb::SMSTenDLCBrandsListResultAllOf](docs/SMSTenDLCBrandsListResultAllOf.md) - [Freeclimb::SMSTenDLCCampaign](docs/SMSTenDLCCampaign.md) + - [Freeclimb::SMSTenDLCCampaignStatus](docs/SMSTenDLCCampaignStatus.md) - [Freeclimb::SMSTenDLCCampaignsListResult](docs/SMSTenDLCCampaignsListResult.md) - - [Freeclimb::SMSTenDLCCampaignsListResultAllOf](docs/SMSTenDLCCampaignsListResultAllOf.md) - [Freeclimb::SMSTenDLCPartnerCampaign](docs/SMSTenDLCPartnerCampaign.md) - [Freeclimb::SMSTenDLCPartnerCampaignBrand](docs/SMSTenDLCPartnerCampaignBrand.md) + - [Freeclimb::SMSTenDLCPartnerCampaignStatus](docs/SMSTenDLCPartnerCampaignStatus.md) - [Freeclimb::SMSTenDLCPartnerCampaignsListResult](docs/SMSTenDLCPartnerCampaignsListResult.md) - - [Freeclimb::SMSTenDLCPartnerCampaignsListResultAllOf](docs/SMSTenDLCPartnerCampaignsListResultAllOf.md) - [Freeclimb::SMSTollFreeCampaign](docs/SMSTollFreeCampaign.md) + - [Freeclimb::SMSTollFreeCampaignRegistrationStatus](docs/SMSTollFreeCampaignRegistrationStatus.md) - [Freeclimb::SMSTollFreeCampaignsListResult](docs/SMSTollFreeCampaignsListResult.md) - - [Freeclimb::SMSTollFreeCampaignsListResultAllOf](docs/SMSTollFreeCampaignsListResultAllOf.md) - [Freeclimb::Say](docs/Say.md) - - [Freeclimb::SayAllOf](docs/SayAllOf.md) - [Freeclimb::SendDigits](docs/SendDigits.md) - - [Freeclimb::SendDigitsAllOf](docs/SendDigitsAllOf.md) - [Freeclimb::SetDTMFPassThrough](docs/SetDTMFPassThrough.md) - - [Freeclimb::SetDTMFPassThroughAllOf](docs/SetDTMFPassThroughAllOf.md) - [Freeclimb::SetListen](docs/SetListen.md) - - [Freeclimb::SetListenAllOf](docs/SetListenAllOf.md) - [Freeclimb::SetTalk](docs/SetTalk.md) - - [Freeclimb::SetTalkAllOf](docs/SetTalkAllOf.md) - [Freeclimb::Sms](docs/Sms.md) - - [Freeclimb::SmsAllOf](docs/SmsAllOf.md) - [Freeclimb::StartRecordCall](docs/StartRecordCall.md) - [Freeclimb::TFN](docs/TFN.md) - [Freeclimb::TerminateConference](docs/TerminateConference.md) + - [Freeclimb::TranscribeReason](docs/TranscribeReason.md) + - [Freeclimb::TranscribeTermReason](docs/TranscribeTermReason.md) - [Freeclimb::TranscribeUtterance](docs/TranscribeUtterance.md) - - [Freeclimb::TranscribeUtteranceAllOf](docs/TranscribeUtteranceAllOf.md) - - [Freeclimb::TranscribeUtteranceAllOfRecord](docs/TranscribeUtteranceAllOfRecord.md) + - [Freeclimb::TranscribeUtteranceRecord](docs/TranscribeUtteranceRecord.md) + - [Freeclimb::TranscribeWebhook](docs/TranscribeWebhook.md) - [Freeclimb::Unpark](docs/Unpark.md) - [Freeclimb::UpdateCallRequest](docs/UpdateCallRequest.md) - [Freeclimb::UpdateCallRequestStatus](docs/UpdateCallRequestStatus.md) - [Freeclimb::UpdateConferenceParticipantRequest](docs/UpdateConferenceParticipantRequest.md) - [Freeclimb::UpdateConferenceRequest](docs/UpdateConferenceRequest.md) - [Freeclimb::UpdateConferenceRequestStatus](docs/UpdateConferenceRequestStatus.md) + - [Freeclimb::Webhook](docs/Webhook.md) ## Documentation for Authorization diff --git a/docs/AccountResultAllOf.md b/docs/AccountResultAllOf.md deleted file mode 100644 index 04125ed9..00000000 --- a/docs/AccountResultAllOf.md +++ /dev/null @@ -1,30 +0,0 @@ -# Freeclimb::AccountResultAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **account_id** | **String** | String that uniquely identifies this account resource. | [optional] | -| **api_key** | **String** | The API key assigned to this account. This key must be kept a secret by the customer. | [optional] | -| **_alias** | **String** | A description for this account. | [optional] | -| **label** | **String** | A string that identifies a category or group to which the account belongs. | [optional] | -| **type** | [**AccountType**](AccountType.md) | | [optional] | -| **status** | [**AccountStatus**](AccountStatus.md) | | [optional] | -| **subresource_uris** | **Object** | The list of subresources for this account. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::AccountResultAllOf.new( - account_id: null, - api_key: null, - _alias: null, - label: null, - type: null, - status: null, - subresource_uris: null -) -``` - diff --git a/docs/AddToConferenceAllOf.md b/docs/AddToConferenceAllOf.md deleted file mode 100644 index 28629d27..00000000 --- a/docs/AddToConferenceAllOf.md +++ /dev/null @@ -1,36 +0,0 @@ -# Freeclimb::AddToConferenceAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **allow_call_control** | **Boolean** | If `true`, Call control will be enabled for this Participant's Call leg. | [optional] | -| **call_control_sequence** | **String** | Defines a sequence of digits that, when entered by this caller, invokes the `callControlUrl`. Only digits plus '*', and '#' may be used. | [optional] | -| **call_control_url** | **String** | URL to be invoked when this Participant enters the digit sequence defined in the `callControlSequence` attribute. | [optional] | -| **conference_id** | **String** | ID of the Conference to which to add the Participant (Call leg). Conference must exist or an error will result. | | -| **leave_conference_url** | **String** | URL to be invoked when the Participant leaves the Conference. | [optional] | -| **listen** | **Boolean** | If `true`, the Participant joins the Conference with listen privileges. This may be modified later via the REST API or `SetListen` PerCL command. | [optional] | -| **notification_url** | **String** | When the Participant enters the Conference, this URL will be invoked using an HTTP POST request with the standard request parameters. | [optional] | -| **start_conf_on_enter** | **Boolean** | Flag that indicates whether a Conference starts upon entry of this particular Participant. This is usually set to `true` for moderators and `false` for all other Participants. | [optional] | -| **talk** | **Boolean** | If `true`, the Participant joins the Conference with talk privileges. This may be modified later via the REST API or `SetTalk` PerCL command. | [optional] | -| **dtmf_pass_through** | **Boolean** | If `true`, the Participant joins the Conference with dtmfPassThrough privileges. This may be modified later via the REST API or `SetDTMFPassThrough` PerCL command. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::AddToConferenceAllOf.new( - allow_call_control: null, - call_control_sequence: null, - call_control_url: null, - conference_id: null, - leave_conference_url: null, - listen: null, - notification_url: null, - start_conf_on_enter: null, - talk: null, - dtmf_pass_through: null -) -``` - diff --git a/docs/AddToConferenceNotificationWebhook.md b/docs/AddToConferenceNotificationWebhook.md new file mode 100644 index 00000000..224aff3c --- /dev/null +++ b/docs/AddToConferenceNotificationWebhook.md @@ -0,0 +1,42 @@ +# Freeclimb::AddToConferenceNotificationWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be addToConferenceNotification - A Call has been bridged to a conference and the addToConference command’s notificationUrl is being invoked. | [optional] | +| **call_id** | **String** | Unique ID for this Call, generated by FreeClimb. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to you and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | Unique ID of the Conference. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a Queue. Otherwise, it is set to null. | [optional] | +| **status** | [**ConferenceStatus**](ConferenceStatus.md) | | [optional] | +| **recording_url** | **String** | URL of the Conference’s recorded audio. Populated only if a Recording exists and the Conference was emptied. | [optional] | +| **recording_id** | **String** | Unique ID of the Recording from this Conference. Populated only if a recording exists and the Conference was emptied. | [optional] | +| **recording_duration_sec** | **Integer** | Duration of the recorded audio (in seconds), rounded up to the nearest second. Populated only if a Recording exists and the Conference was emptied. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: null, + call_id: null, + account_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null, + status: null, + recording_url: null, + recording_id: null, + recording_duration_sec: null +) +``` + diff --git a/docs/AddToQueueNotificationWebhook.md b/docs/AddToQueueNotificationWebhook.md new file mode 100644 index 00000000..f2dbe957 --- /dev/null +++ b/docs/AddToQueueNotificationWebhook.md @@ -0,0 +1,34 @@ +# Freeclimb::AddToQueueNotificationWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be addToQueueNotification - A call has been added to a queue and the Enqueue command’s notificationUrl is being invoked. | [optional] | +| **call_id** | **String** | Unique ID for this Call, generated by FreeClimb. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to you and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | Unique ID of the Conference. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a Queue. Otherwise, it is set to null. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: null, + call_id: null, + account_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null +) +``` + diff --git a/docs/ApplicationListAllOf.md b/docs/ApplicationListAllOf.md deleted file mode 100644 index 2686f8b6..00000000 --- a/docs/ApplicationListAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::ApplicationListAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **applications** | [**Array<ApplicationResult>**](ApplicationResult.md) | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::ApplicationListAllOf.new( - applications: null -) -``` - diff --git a/docs/ApplicationResultAllOf.md b/docs/ApplicationResultAllOf.md deleted file mode 100644 index 27cc113b..00000000 --- a/docs/ApplicationResultAllOf.md +++ /dev/null @@ -1,34 +0,0 @@ -# Freeclimb::ApplicationResultAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **account_id** | **String** | ID of the account that owns this phone number. | [optional] | -| **application_id** | **String** | ID of the Application that FreeClimb should contact if a Call or SMS arrives for this phone number or a Call from this number is placed. An incoming phone number is not useful until associated with an applicationId. | [optional] | -| **_alias** | **String** | Description for this phone number. Typically the conventionally-formatted version of the phone number. | [optional] | -| **voice_url** | **String** | The URL FreeClimb will request when a phone number assigned to this Application receives a Call. Used for inbound calls only. | [optional] | -| **voice_fallback_url** | **String** | The URL that FreeClimb will request if it times out waiting for a response from the voiceUrl. Used for inbound calls only. | [optional] | -| **call_connect_url** | **String** | The URL to which FreeClimb will make a POST request informing the result of the outbound Call request. The status property of the request message specifies if the Call was connected or not. | [optional] | -| **status_callback_url** | **String** | A URL to which FreeClimb will make a POST request when the Call ends to notify this app. | [optional] | -| **sms_url** | **String** | The URL FreeClimb will request when a phone number assigned to this Application receives an incoming SMS message. Used for inbound SMS only. | [optional] | -| **sms_fallback_url** | **String** | The URL that FreeClimb will request if it times out waiting for a response from the smsUrl. Used for inbound SMS only. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::ApplicationResultAllOf.new( - account_id: null, - application_id: null, - _alias: null, - voice_url: null, - voice_fallback_url: null, - call_connect_url: null, - status_callback_url: null, - sms_url: null, - sms_fallback_url: null -) -``` - diff --git a/docs/AvailableNumberListAllOf.md b/docs/AvailableNumberListAllOf.md deleted file mode 100644 index 13d80c8f..00000000 --- a/docs/AvailableNumberListAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::AvailableNumberListAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **available_phone_numbers** | [**Array<AvailableNumber>**](AvailableNumber.md) | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::AvailableNumberListAllOf.new( - available_phone_numbers: null -) -``` - diff --git a/docs/BargeInReason.md b/docs/BargeInReason.md new file mode 100644 index 00000000..089f0fa5 --- /dev/null +++ b/docs/BargeInReason.md @@ -0,0 +1,18 @@ +# Freeclimb::BargeInReason + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **NO_BARGE_IN** | **BargeInReason** | | Represented in Ruby as "noBargeIn" | +| **BARGE_IN_BY_DTMF** | **BargeInReason** | | Represented in Ruby as "bargeInByDTMF" | +| **BARGE_IN_BY_ENERGY** | **BargeInReason** | | Represented in Ruby as "bargeInByEnergy" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::BargeInReason::[NAME OF ENUM] +``` + diff --git a/docs/CallControlWebhook.md b/docs/CallControlWebhook.md new file mode 100644 index 00000000..7915f070 --- /dev/null +++ b/docs/CallControlWebhook.md @@ -0,0 +1,26 @@ +# Freeclimb::CallControlWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be callControl. | [optional] | +| **call_id** | **String** | Unique ID for this Call, generated by FreeClimb. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **conference_id** | **String** | Unique ID of the Conference. | [optional] | +| **digits** | **String** | String of digits entered by the participant. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::CallControlWebhook.new( + request_type: null, + call_id: null, + account_id: null, + conference_id: null, + digits: null +) +``` + diff --git a/docs/CallEndedReason.md b/docs/CallEndedReason.md new file mode 100644 index 00000000..4e0a3895 --- /dev/null +++ b/docs/CallEndedReason.md @@ -0,0 +1,38 @@ +# Freeclimb::CallEndedReason + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **BUSY** | **CallEndedReason** | | Represented in Ruby as "busy" | +| **FAILED** | **CallEndedReason** | | Represented in Ruby as "failed" | +| **NO_ANSWER** | **CallEndedReason** | | Represented in Ruby as "noAnswer" | +| **CALL_CANCELED** | **CallEndedReason** | | Represented in Ruby as "callCanceled" | +| **FAR_END_HANGUP** | **CallEndedReason** | | Represented in Ruby as "farEndHangup" | +| **APP_HANGUP** | **CallEndedReason** | | Represented in Ruby as "appHangup" | +| **APP_REJECT** | **CallEndedReason** | | Represented in Ruby as "appReject" | +| **APP_NO_PERCL** | **CallEndedReason** | | Represented in Ruby as "appNoPercl" | +| **APP_INVALID_PERCL** | **CallEndedReason** | | Represented in Ruby as "appInvalidPercl" | +| **CONFERENCE_TERMINATED** | **CallEndedReason** | | Represented in Ruby as "conferenceTerminated" | +| **CONFERENCE_EMPTIED** | **CallEndedReason** | | Represented in Ruby as "conferenceEmptied" | +| **REMOVED_FROM_CONFERENCE** | **CallEndedReason** | | Represented in Ruby as "removedFromConference" | +| **MACHINE_DETECTED** | **CallEndedReason** | | Represented in Ruby as "machineDetected" | +| **WEBHOOK_FAILED** | **CallEndedReason** | | Represented in Ruby as "webhookFailed" | +| **WEBHOOK_INVALID_RESPONSE** | **CallEndedReason** | | Represented in Ruby as "webhookInvalidResponse" | +| **VOICE_DISABLED** | **CallEndedReason** | | Represented in Ruby as "voiceDisabled" | +| **CONFIG_ERROR_NO_APPLICATION** | **CallEndedReason** | | Represented in Ruby as "configErrorNoApplication" | +| **CONFIG_ERROR_NO_VOICE_URL** | **CallEndedReason** | | Represented in Ruby as "configErrorNoVoiceUrl" | +| **MAX_REDIRECTS_ERROR** | **CallEndedReason** | | Represented in Ruby as "maxRedirectsError" | +| **PERCL_PROCESSING_ERROR** | **CallEndedReason** | | Represented in Ruby as "perclProcessingError" | +| **INTERNAL_ERROR** | **CallEndedReason** | | Represented in Ruby as "internalError" | +| **GRPC_HANGUP** | **CallEndedReason** | | Represented in Ruby as "grpcHangup" | +| **MAX_DURATION** | **CallEndedReason** | | Represented in Ruby as "maxDuration" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::CallEndedReason::[NAME OF ENUM] +``` + diff --git a/docs/CallListAllOf.md b/docs/CallListAllOf.md deleted file mode 100644 index 1bd60b5f..00000000 --- a/docs/CallListAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::CallListAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **calls** | [**Array<CallResult>**](CallResult.md) | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::CallListAllOf.new( - calls: null -) -``` - diff --git a/docs/CallResultAllOf.md b/docs/CallResultAllOf.md deleted file mode 100644 index 75875902..00000000 --- a/docs/CallResultAllOf.md +++ /dev/null @@ -1,48 +0,0 @@ -# Freeclimb::CallResultAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **call_id** | **String** | String that uniquely identifies this Call resource. | [optional] | -| **parent_call_id** | **String** | ID of the Call that created this leg (child Call). | [optional] | -| **account_id** | **String** | ID of the account that owns this Call. | [optional] | -| **from** | **String** | Phone number that initiated this Call. | [optional] | -| **to** | **String** | Phone number that received this Call. | [optional] | -| **phone_number_id** | **String** | If the Call was inbound, this is the ID of the IncomingPhoneNumber that received the Call (DNIS). If the Call was outbound, this is the ID of the phone number from which the Call was placed (ANI). | [optional] | -| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | -| **start_time** | **String** | Start time of the Call (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call has not yet been dialed. | [optional] | -| **connect_time** | **String** | Time the Call was answered (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call has not yet been dialed. | [optional] | -| **end_time** | **String** | End time of the Call (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call did not complete successfully. | [optional] | -| **duration** | **Integer** | Total length of the Call in seconds. Measures time between startTime and endTime. This value is empty for busy, failed, unanswered or ongoing Calls. | [optional] | -| **connect_duration** | **Integer** | Length of time that the Call was connected in seconds. Measures time between connectTime and endTime. This value is empty for busy, failed, unanswered or ongoing Calls. | [optional] | -| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | -| **answered_by** | [**AnsweredBy**](AnsweredBy.md) | | [optional] | -| **subresource_uris** | **Object** | The list of subresources for this Call. These include things like logs and recordings associated with the Call. | [optional] | -| **application_id** | **String** | ApplicationId associated with the Call. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::CallResultAllOf.new( - call_id: null, - parent_call_id: null, - account_id: null, - from: null, - to: null, - phone_number_id: null, - call_status: null, - start_time: null, - connect_time: null, - end_time: null, - duration: null, - connect_duration: null, - direction: null, - answered_by: null, - subresource_uris: null, - application_id: null -) -``` - diff --git a/docs/CallStatusWebhook.md b/docs/CallStatusWebhook.md new file mode 100644 index 00000000..4b974105 --- /dev/null +++ b/docs/CallStatusWebhook.md @@ -0,0 +1,36 @@ +# Freeclimb::CallStatusWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be callStatus - A Call has ended and the statusCallbackUrl is being invoked. | [optional] | +| **call_id** | **String** | Unique ID for this Call, generated by FreeClimb. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to you and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **call_ended_reason** | [**CallEndedReason**](CallEndedReason.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | Unique ID of the Conference. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a Queue. Otherwise, it is set to null. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::CallStatusWebhook.new( + request_type: null, + call_id: null, + account_id: null, + from: null, + to: null, + call_status: null, + call_ended_reason: null, + direction: null, + conference_id: null, + queue_id: null +) +``` + diff --git a/docs/CompletionResult.md b/docs/CompletionResult.md index fcdf3de7..f6574735 100644 --- a/docs/CompletionResult.md +++ b/docs/CompletionResult.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **response** | **String** | The generative response from the KnowledgeBase | | -| **status** | **String** | Completion result status. Possible values: success, no_context | | +| **status** | [**CompletionResultStatus**](CompletionResultStatus.md) | | | ## Example diff --git a/docs/CompletionResultStatus.md b/docs/CompletionResultStatus.md new file mode 100644 index 00000000..4cb4411f --- /dev/null +++ b/docs/CompletionResultStatus.md @@ -0,0 +1,17 @@ +# Freeclimb::CompletionResultStatus + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **SUCCESS** | **CompletionResultStatus** | | Represented in Ruby as "success" | +| **NO_CONTEXT** | **CompletionResultStatus** | | Represented in Ruby as "no_context" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::CompletionResultStatus::[NAME OF ENUM] +``` + diff --git a/docs/ConferenceListAllOf.md b/docs/ConferenceListAllOf.md deleted file mode 100644 index b4f8fa18..00000000 --- a/docs/ConferenceListAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::ConferenceListAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **conferences** | [**Array<ConferenceResult>**](ConferenceResult.md) | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::ConferenceListAllOf.new( - conferences: null -) -``` - diff --git a/docs/ConferenceParticipantListAllOf.md b/docs/ConferenceParticipantListAllOf.md deleted file mode 100644 index a97a31b8..00000000 --- a/docs/ConferenceParticipantListAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::ConferenceParticipantListAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **participants** | [**Array<ConferenceParticipantResult>**](ConferenceParticipantResult.md) | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::ConferenceParticipantListAllOf.new( - participants: null -) -``` - diff --git a/docs/ConferenceParticipantResultAllOf.md b/docs/ConferenceParticipantResultAllOf.md deleted file mode 100644 index 456729b8..00000000 --- a/docs/ConferenceParticipantResultAllOf.md +++ /dev/null @@ -1,30 +0,0 @@ -# Freeclimb::ConferenceParticipantResultAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **account_id** | **String** | ID of the account that created this participant. | [optional] | -| **conference_id** | **String** | ID of the conference this participant is in. | [optional] | -| **call_id** | **String** | ID of the Call associated with this Participant. | [optional] | -| **talk** | **Boolean** | True if this Participant has talk privileges in the Conference. False otherwise. | [optional] | -| **listen** | **Boolean** | True if this Participant has listen privileges in the Conference. False otherwise. | [optional] | -| **dtmf_pass_through** | **Boolean** | True if this Participant had dtmfPassThrough privileges in the Conference. False otherwise. | [optional] | -| **start_conf_on_enter** | **Boolean** | True if this Participant joining the Conference caused the Conference to start (status = inProgress). False otherwise. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::ConferenceParticipantResultAllOf.new( - account_id: null, - conference_id: null, - call_id: null, - talk: null, - listen: null, - dtmf_pass_through: null, - start_conf_on_enter: null -) -``` - diff --git a/docs/ConferenceRecordingStatusWebhook.md b/docs/ConferenceRecordingStatusWebhook.md new file mode 100644 index 00000000..21ba9112 --- /dev/null +++ b/docs/ConferenceRecordingStatusWebhook.md @@ -0,0 +1,42 @@ +# Freeclimb::ConferenceRecordingStatusWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be conferenceRecordingStatus - The statusCallbackUrl request includes Recording information for a Conference that ended. | [optional] | +| **call_id** | **String** | Unique ID for this Call, generated by FreeClimb. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to you and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | Unique ID of the Conference. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a Queue. Otherwise, it is set to null. | [optional] | +| **status** | [**ConferenceStatus**](ConferenceStatus.md) | | [optional] | +| **recording_url** | **String** | URL of the Conference’s recorded audio. Populated only if a Recording exists and the Conference was emptied. | [optional] | +| **recording_id** | **String** | Unique ID of the Recording from this Conference. Populated only if a recording exists and the Conference was emptied. | [optional] | +| **recording_duration_sec** | **Integer** | Duration of the recorded audio (in seconds), rounded up to the nearest second. Populated only if a Recording exists and the Conference was emptied. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: null, + call_id: null, + account_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null, + status: null, + recording_url: null, + recording_id: null, + recording_duration_sec: null +) +``` + diff --git a/docs/ConferenceResult.md b/docs/ConferenceResult.md index 56e77fe7..a7b560da 100644 --- a/docs/ConferenceResult.md +++ b/docs/ConferenceResult.md @@ -11,7 +11,7 @@ | **conference_id** | **String** | A string that uniquely identifies this Conference resource. | [optional] | | **account_id** | **String** | ID of the account that created this Conference. | [optional] | | **_alias** | **String** | A description for this Conference. | [optional] | -| **play_beep** | [**PlayBeep**](PlayBeep.md) | | [optional][default to 'always'] | +| **play_beep** | [**PlayBeep**](PlayBeep.md) | | [optional] | | **record** | **Boolean** | Flag indicating whether recording is enabled for this Conference. | [optional] | | **status** | [**ConferenceStatus**](ConferenceStatus.md) | | [optional] | | **wait_url** | **String** | URL referencing the audio file to be used as default wait music for the Conference when it is in the populated state. | [optional] | diff --git a/docs/ConferenceResultAllOf.md b/docs/ConferenceResultAllOf.md deleted file mode 100644 index 44b7288d..00000000 --- a/docs/ConferenceResultAllOf.md +++ /dev/null @@ -1,36 +0,0 @@ -# Freeclimb::ConferenceResultAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **conference_id** | **String** | A string that uniquely identifies this Conference resource. | [optional] | -| **account_id** | **String** | ID of the account that created this Conference. | [optional] | -| **_alias** | **String** | A description for this Conference. | [optional] | -| **play_beep** | [**PlayBeep**](PlayBeep.md) | | [optional][default to 'always'] | -| **record** | **Boolean** | Flag indicating whether recording is enabled for this Conference. | [optional] | -| **status** | [**ConferenceStatus**](ConferenceStatus.md) | | [optional] | -| **wait_url** | **String** | URL referencing the audio file to be used as default wait music for the Conference when it is in the populated state. | [optional] | -| **action_url** | **String** | URL invoked once the Conference is successfully created. | [optional] | -| **status_callback_url** | **String** | URL to inform that the Conference status has changed. | [optional] | -| **subresource_uris** | **Object** | The list of subresources for this Conference. This includes participants and/or recordings. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::ConferenceResultAllOf.new( - conference_id: null, - account_id: null, - _alias: null, - play_beep: null, - record: null, - status: null, - wait_url: null, - action_url: null, - status_callback_url: null, - subresource_uris: null -) -``` - diff --git a/docs/ConferenceStatusWebhook.md b/docs/ConferenceStatusWebhook.md new file mode 100644 index 00000000..d9de84a8 --- /dev/null +++ b/docs/ConferenceStatusWebhook.md @@ -0,0 +1,42 @@ +# Freeclimb::ConferenceStatusWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be conferenceRecordingStatus - The statusCallbackUrl request includes Recording information for a Conference that ended. | [optional] | +| **call_id** | **String** | Unique ID for this Call, generated by FreeClimb. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to you and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | Unique ID of the Conference. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a Queue. Otherwise, it is set to null. | [optional] | +| **status** | [**ConferenceStatus**](ConferenceStatus.md) | | [optional] | +| **recording_url** | **String** | The URL of the Conference’s recorded audio. Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked. | [optional] | +| **recording_id** | **String** | The unique ID of the Recording from this Conference. Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked. | [optional] | +| **recording_duration_sec** | **Integer** | The duration of the recorded audio rounded up to the nearest second (in seconds). Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::ConferenceStatusWebhook.new( + request_type: null, + call_id: null, + account_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null, + status: null, + recording_url: null, + recording_id: null, + recording_duration_sec: null +) +``` + diff --git a/docs/CreateConference.md b/docs/CreateConference.md index fdd96294..30b55afe 100644 --- a/docs/CreateConference.md +++ b/docs/CreateConference.md @@ -6,7 +6,7 @@ | ---- | ---- | ----------- | ----- | | **action_url** | **String** | This URL is invoked once the Conference is successfully created. Actions on the Conference, such as adding Participants, can be performed via the PerCL script returned in the response. | | | **_alias** | **Boolean** | Descriptive name for the Conference. | [optional] | -| **play_beep** | [**PlayBeep**](PlayBeep.md) | | [optional][default to 'always'] | +| **play_beep** | [**PlayBeep**](PlayBeep.md) | | [optional] | | **record** | **Boolean** | When set to `true`, the entire Conference is recorded. The `statusCallbackUrl` of the Conference will receive a `conferenceRecordingEnded` Webhook when the Conference transitions from the `inProgress` to empty state. | [optional] | | **status_callback_url** | **String** | This URL is invoked when the status of the Conference changes or when a recording of the Conference has become available. | [optional] | | **wait_url** | **String** | If specified, this URL provides the custom hold music for the Conference when it is in the populated state. This attribute is always fetched using HTTP GET and is fetched just once – when the Conference is created. The URL must be an audio file that is reachable and readable by FreeClimb. | [optional] | diff --git a/docs/CreateConferenceAllOf.md b/docs/CreateConferenceAllOf.md deleted file mode 100644 index 26e73ba5..00000000 --- a/docs/CreateConferenceAllOf.md +++ /dev/null @@ -1,28 +0,0 @@ -# Freeclimb::CreateConferenceAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **action_url** | **String** | This URL is invoked once the Conference is successfully created. Actions on the Conference, such as adding Participants, can be performed via the PerCL script returned in the response. | | -| **_alias** | **Boolean** | Descriptive name for the Conference. | [optional] | -| **play_beep** | [**PlayBeep**](PlayBeep.md) | | [optional][default to 'always'] | -| **record** | **Boolean** | When set to `true`, the entire Conference is recorded. The `statusCallbackUrl` of the Conference will receive a `conferenceRecordingEnded` Webhook when the Conference transitions from the `inProgress` to empty state. | [optional] | -| **status_callback_url** | **String** | This URL is invoked when the status of the Conference changes or when a recording of the Conference has become available. | [optional] | -| **wait_url** | **String** | If specified, this URL provides the custom hold music for the Conference when it is in the populated state. This attribute is always fetched using HTTP GET and is fetched just once – when the Conference is created. The URL must be an audio file that is reachable and readable by FreeClimb. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::CreateConferenceAllOf.new( - action_url: null, - _alias: null, - play_beep: null, - record: null, - status_callback_url: null, - wait_url: null -) -``` - diff --git a/docs/CreateConferenceRequest.md b/docs/CreateConferenceRequest.md index e683d8b3..c45c55a4 100644 --- a/docs/CreateConferenceRequest.md +++ b/docs/CreateConferenceRequest.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **_alias** | **String** | A description for this Conference. Maximum 64 characters. | [optional] | -| **play_beep** | [**PlayBeep**](PlayBeep.md) | | [optional][default to 'always'] | +| **play_beep** | [**PlayBeep**](PlayBeep.md) | | [optional] | | **record** | **Boolean** | Setting to `true` records the entire Conference. | [optional] | | **wait_url** | **String** | If specified, a URL for the audio file that provides custom hold music for the Conference when it is in the populated state. Otherwise, FreeClimb uses a system default audio file. This is always fetched using HTTP GET and is fetched just once &mdash; when the Conference is created. | [optional] | | **status_callback_url** | **String** | This URL is invoked when the status of the Conference changes. For more information, see **statusCallbackUrl** (below). | [optional] | diff --git a/docs/CreateConferenceWebhook.md b/docs/CreateConferenceWebhook.md new file mode 100644 index 00000000..ed901f7f --- /dev/null +++ b/docs/CreateConferenceWebhook.md @@ -0,0 +1,42 @@ +# Freeclimb::CreateConferenceWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be createConference - A Conference has been created and its statusCallbackUrl or actionUrl is being invoked. | [optional] | +| **call_id** | **String** | Unique ID for this Call, generated by FreeClimb. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to you and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | Unique ID of the Conference. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a Queue. Otherwise, it is set to null. | [optional] | +| **status** | [**ConferenceStatus**](ConferenceStatus.md) | | [optional] | +| **recording_url** | **String** | The URL of the Conference’s recorded audio. Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked. | [optional] | +| **recording_id** | **String** | The unique ID of the Recording from this Conference. Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked. | [optional] | +| **recording_duration_sec** | **Integer** | The duration of the recorded audio rounded up to the nearest second (in seconds). Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::CreateConferenceWebhook.new( + request_type: null, + call_id: null, + account_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null, + status: null, + recording_url: null, + recording_id: null, + recording_duration_sec: null +) +``` + diff --git a/docs/DequeueWebhook.md b/docs/DequeueWebhook.md new file mode 100644 index 00000000..820603e4 --- /dev/null +++ b/docs/DequeueWebhook.md @@ -0,0 +1,38 @@ +# Freeclimb::DequeueWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be dequeue - A queued call has been dequeued and the actionUrl of the corresponding Enqueue action is being invoked. | [optional] | +| **call_id** | **String** | Unique ID for this Call, generated by FreeClimb. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to you and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | Unique ID of the Conference. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a Queue. Otherwise, it is set to null. | [optional] | +| **queue_result** | **String** | The final result of the enqueued Call. Valid values are: •dequeued - Enqueued caller exited the Queue via a Dequeue action (Dequeue command or Queue Members POST REST API). | [optional] | +| **queue_time** | **Integer** | Time (in seconds) the call spent in the Queue. This is only available if the Call was actually enqueued. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::DequeueWebhook.new( + request_type: null, + call_id: null, + account_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null, + queue_result: null, + queue_time: null +) +``` + diff --git a/docs/EnqueueAllOf.md b/docs/EnqueueAllOf.md deleted file mode 100644 index 26195f4b..00000000 --- a/docs/EnqueueAllOf.md +++ /dev/null @@ -1,24 +0,0 @@ -# Freeclimb::EnqueueAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **action_url** | **String** | A request is made to this URL when the Call leaves the Queue, which can occur if enqueue of the Call fails or when the call is dequeued via the `Dequeue` command, the REST API (POST to Queue Member resource), or the caller hangs up. | | -| **notification_url** | **String** | URL to be invoked when the call enters the queue. The request to the URL contains the standard request parameters.This is a notification only; any PerCL returned will be ignored. | [optional] | -| **queue_id** | **String** | ID of the Queue to which to add the Call. If the Queue does not exist, it will be created. The ID must start with QU followed by 40 hex characters. | | -| **wait_url** | **String** | A request is made to this URL when the Call leaves the Queue, which can occur if enqueue of the Call fails or when the call is dequeued via the `Dequeue` command, the REST API (POST to Queue Member resource), or the caller hangs up. | | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::EnqueueAllOf.new( - action_url: null, - notification_url: null, - queue_id: null, - wait_url: null -) -``` - diff --git a/docs/GetDigitsAllOf.md b/docs/GetDigitsAllOf.md deleted file mode 100644 index 95b2afed..00000000 --- a/docs/GetDigitsAllOf.md +++ /dev/null @@ -1,34 +0,0 @@ -# Freeclimb::GetDigitsAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **action_url** | **String** | When the Caller has finished entering digits, FreeClimb will make an HTTP POST request to this URL. A PerCL response is expected to continue handling the Call. Make sure to keep “http://“ in the URL. | | -| **digit_timeout_ms** | **Integer** | Maximum time in milliseconds that FreeClimb will wait for the Caller to press any digit after the last digit entered, before making a determination that a `timeout` has occurred and moving on to make the request to the actionUrl to submit the results of the `GetDigits` command. This timeout interval begins and resets after each digit entered. | [optional] | -| **finish_on_key** | **String** | Digit that causes the input sequence to be deemed complete. This attribute defers to the `timeout` attribute – so, if a `timeout` occurs, then the command terminates regardless of the value of `finishOnKey`. | [optional] | -| **flush_buffer** | **Boolean** | If set to true, the FreeClimb platform starts with an empty DTMF buffer to store the digits entered by the caller. If set to false, FreeClimb will append the user inputs to the end of the existing digits buffer and will return digits from the start of the digits buffer. | [optional] | -| **initial_timeout_ms** | **Integer** | Maximum time in milliseconds that FreeClimb will wait for the Caller to press the first digit before making a determination that a `timeout` has occurred and moving on to make the request to the `actionUrl` to submit the results of the `GetDigits` command. This timeout interval begins when all nested commands have been fully executed. | [optional] | -| **max_digits** | **Integer** | Maximum number of digits expected in the input. If the terminating digit is not entered and the caller has entered the maximum number of digits allowed, the `GetDigits` command terminates regardless of the value of `finishOnKey`. | [optional] | -| **min_digits** | **Integer** | Minimum number of digits expected in the input. If specified, FreeClimb will return the collected digits only if the Caller has entered at least that many digits. | [optional] | -| **prompts** | [**Array<PerclCommand>**](PerclCommand.md) | JSON array of PerCL commands to nest within the `GetDigits` command. The `Say`, `Play`, and `Pause` commands can be used. The nested actions are executed while FreeClimb is waiting for input from the Caller. | [optional] | -| **privacy_mode** | **Boolean** | Parameter `privacyMode` will not log the `text` as required by PCI compliance. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::GetDigitsAllOf.new( - action_url: null, - digit_timeout_ms: null, - finish_on_key: null, - flush_buffer: null, - initial_timeout_ms: null, - max_digits: null, - min_digits: null, - prompts: null, - privacy_mode: null -) -``` - diff --git a/docs/GetDigitsReason.md b/docs/GetDigitsReason.md new file mode 100644 index 00000000..9e36e92b --- /dev/null +++ b/docs/GetDigitsReason.md @@ -0,0 +1,19 @@ +# Freeclimb::GetDigitsReason + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **FINISH_KEY** | **GetDigitsReason** | | Represented in Ruby as "finishKey" | +| **TIMEOUT** | **GetDigitsReason** | | Represented in Ruby as "timeout" | +| **MAX_DIGITS** | **GetDigitsReason** | | Represented in Ruby as "maxDigits" | +| **TONE** | **GetDigitsReason** | | Represented in Ruby as "tone" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::GetDigitsReason::[NAME OF ENUM] +``` + diff --git a/docs/GetDigitsWebhook.md b/docs/GetDigitsWebhook.md new file mode 100644 index 00000000..792d6619 --- /dev/null +++ b/docs/GetDigitsWebhook.md @@ -0,0 +1,40 @@ +# Freeclimb::GetDigitsWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be getDigits - The GetDigits command has completed and its actionUrl is being invoked. | [optional] | +| **call_id** | **String** | Unique ID for this Call, generated by FreeClimb. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to you and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | Unique ID of the Conference. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a Queue. Otherwise, it is set to null. | [optional] | +| **digits** | **String** | tring of digits entered by the Caller, excluding the terminating digit (if used). The string of digits will be replaced by 'xxxxx' when privacyMode is set to true | [optional] | +| **reason** | [**GetDigitsReason**](GetDigitsReason.md) | | [optional] | +| **parent_call_id** | **String** | ID of the Call that created this leg (child call). | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::GetDigitsWebhook.new( + request_type: null, + call_id: null, + account_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null, + digits: null, + reason: null, + parent_call_id: null +) +``` + diff --git a/docs/GetSpeechAllOf.md b/docs/GetSpeechAllOf.md deleted file mode 100644 index 8d2cf061..00000000 --- a/docs/GetSpeechAllOf.md +++ /dev/null @@ -1,42 +0,0 @@ -# Freeclimb::GetSpeechAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **action_url** | **String** | When the caller has finished speaking or the command has timed out, FreeClimb will make a POST request to this URL. A PerCL response is expected to continue handling the call. | | -| **grammar_type** | [**GrammarType**](GrammarType.md) | | [optional] | -| **grammar_file** | **String** | The grammar file to use for speech recognition. If grammarType is set to URL, this attribute is specified as a download URL. | | -| **grammar_rule** | **String** | The grammar rule within the specified grammar file to use for speech recognition. This attribute is optional if `grammarType` is `URL` and ignored if `grammarType` is `BUILTIN`. | [optional] | -| **play_beep** | **Boolean** | Indicates whether a beep should be played just before speech recognition is initiated so that the speaker can start to speak. | [optional] | -| **prompts** | [**Array<PerclCommand>**](PerclCommand.md) | The JSON array of PerCL commands to nest within the `GetSpeech` command. The `Say`, `Play`, and `Pause` commands can be used. The nested actions are executed while FreeClimb is waiting for input from the caller. This allows for playing menu options to the caller and to prompt for the expected input. These commands stop executing when the caller begins to input speech. | [optional] | -| **no_input_timeout_ms** | **Integer** | When recognition is started and there is no speech detected for `noInputTimeoutMs` milliseconds, the recognizer will terminate the recognition operation. | [optional] | -| **recognition_timeout_ms** | **Integer** | When playback of prompts ends and there is no match for `recognitionTimeoutMs` milliseconds, the recognizer will terminate the recognition operation. | [optional] | -| **confidence_threshold** | **Float** | When a recognition resource recognizes a spoken phrase, it associates a confidence level with that match. Parameter `confidenceThreshold` specifies what confidence level is considered a successful match. Values are between 0.0 and 1.0. | [optional] | -| **sensitivity_level** | **Float** | The speech recognizer supports a variable level of sound sensitivity. The sensitivityLevel attribute allows for filtering out background noise, so it is not mistaken for speech. Values are between 0.0 and 1.0 | [optional] | -| **speech_complete_timeout_ms** | **Integer** | Parameter `speechCompleteTimeoutMs` specifies the length of silence required following user speech before the speech recognizer finalizes a result. This timeout applies when the recognizer currently has a complete match against an active grammar. Reasonable speech complete timeout values are typically in the range of 0.3 seconds to 1.0 seconds. | [optional] | -| **speech_incomplete_timeout_ms** | **Integer** | Parameter `speechIncompleteTimeoutMs` specifies the length of silence following user speech after which a recognizer finalizes a result. This timeout applies when the speech prior to the silence is an incomplete match of all active grammars. Timeout `speechIncompleteTimeoutMs` is usually longer than `speechCompleteTimeoutMs` to allow users to pause mid-utterance. | [optional] | -| **privacy_mode** | **Boolean** | Parameter privacyMode will not log the `text` as required by PCI compliance. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::GetSpeechAllOf.new( - action_url: null, - grammar_type: null, - grammar_file: null, - grammar_rule: null, - play_beep: null, - prompts: null, - no_input_timeout_ms: null, - recognition_timeout_ms: null, - confidence_threshold: null, - sensitivity_level: null, - speech_complete_timeout_ms: null, - speech_incomplete_timeout_ms: null, - privacy_mode: null -) -``` - diff --git a/docs/GetSpeechWebhook.md b/docs/GetSpeechWebhook.md new file mode 100644 index 00000000..9c449324 --- /dev/null +++ b/docs/GetSpeechWebhook.md @@ -0,0 +1,50 @@ +# Freeclimb::GetSpeechWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be getSpeech - The GetSpeech command has completed and its actionUrl is being invoked. | [optional] | +| **call_id** | **String** | Unique ID for this Call, generated by FreeClimb. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to you and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | Unique ID of the Conference. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a Queue. Otherwise, it is set to null. | [optional] | +| **reason** | [**GetSpeechReason**](GetSpeechReason.md) | | [optional] | +| **recognition_result** | **String** | Semantic content (either a string if speech was recognized or a digit if a digit was input instead of speech) returned from the entry or tag that was recognized within the grammar. The content will be replaced by 'xxxxx' when privacyMode is set to true. This field is populated only if the reason field is set to recognition or digit. | [optional] | +| **confidence** | **Integer** | Level of confidence in the obtained result. This is a value in the range 0 to 100 – with 0 being total lack of confidence and 100 being absolute certainty in the recognition. This field is populated only if the reason field is set to recognition. | [optional] | +| **parent_call_id** | **String** | ID of the Call that created this leg (child call). | [optional] | +| **completion_reason** | **String** | Advanced diagnostic information if reason was error. See RFC 6787 section 9.4.12 - speech recognition. | [optional] | +| **completion_cause** | **String** | Advanced diagnostic information if reason was error. See RFC 6787 section 9.4.11 - speech recognition. | [optional] | +| **mrcp_code** | **Integer** | Advanced diagnostic information if reason was error. See RFC 6787 section 5.4 - MRCPv2 specification. | [optional] | +| **mrcp_diagnostic** | **String** | Advanced diagnostic information if reason was error. See RFC 6787 section 5.4 - MRCPv2 specification. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::GetSpeechWebhook.new( + request_type: null, + call_id: null, + account_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null, + reason: null, + recognition_result: null, + confidence: null, + parent_call_id: null, + completion_reason: null, + completion_cause: null, + mrcp_code: null, + mrcp_diagnostic: null +) +``` + diff --git a/docs/HangupAllOf.md b/docs/HangupAllOf.md deleted file mode 100644 index 2548f382..00000000 --- a/docs/HangupAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::HangupAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **reason** | **String** | The user defined reason for the hangup. In general, applications should use a set of enumerated values that are predefined to cover all exit points of the Call flows for the given application. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::HangupAllOf.new( - reason: null -) -``` - diff --git a/docs/InboundCallWebhook.md b/docs/InboundCallWebhook.md new file mode 100644 index 00000000..f08ab106 --- /dev/null +++ b/docs/InboundCallWebhook.md @@ -0,0 +1,36 @@ +# Freeclimb::InboundCallWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be inboundCall - An inbound call was received and the voiceUrl is being invoked. | [optional] | +| **call_id** | **String** | Unique ID for this Call, generated by FreeClimb. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to you and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | This is only populated if request pertains to a Conference. Otherwise, it is set to null. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a Queue. Otherwise, it is set to null. | [optional] | +| **parent_call_id** | **String** | | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::InboundCallWebhook.new( + request_type: null, + call_id: null, + account_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null, + parent_call_id: null +) +``` + diff --git a/docs/IncomingNumberListAllOf.md b/docs/IncomingNumberListAllOf.md deleted file mode 100644 index 92625ac6..00000000 --- a/docs/IncomingNumberListAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::IncomingNumberListAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **incoming_phone_numbers** | [**Array<IncomingNumberResult>**](IncomingNumberResult.md) | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::IncomingNumberListAllOf.new( - incoming_phone_numbers: null -) -``` - diff --git a/docs/IncomingNumberResultAllOf.md b/docs/IncomingNumberResultAllOf.md deleted file mode 100644 index 3e613637..00000000 --- a/docs/IncomingNumberResultAllOf.md +++ /dev/null @@ -1,42 +0,0 @@ -# Freeclimb::IncomingNumberResultAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **capabilities** | [**Capabilities**](Capabilities.md) | | [optional] | -| **campaign_id** | **String** | The campaign ID generated by the campaign registry | [optional] | -| **phone_number_id** | **String** | String that uniquely identifies this phone number resource. | [optional] | -| **account_id** | **String** | ID of the account that owns this phone number. | [optional] | -| **application_id** | **String** | ID of the Application that FreeClimb should contact if a Call or SMS arrives for this phone number or a Call from this number is placed. An incoming phone number is not useful until associated with an applicationId. | [optional] | -| **phone_number** | **String** | Phone number in E.164 format. | [optional] | -| **_alias** | **String** | Description for this phone number. Typically the conventionally-formatted version of the phone number. | [optional] | -| **region** | **String** | State or province of this phone number. | [optional] | -| **country** | **String** | Country of this phone number. | [optional] | -| **voice_enabled** | **Boolean** | Indicates whether the phone number can handle Calls. Typically set to true for all numbers. | [optional] | -| **sms_enabled** | **Boolean** | Indication of whether the phone number can handle sending and receiving SMS messages. Typically set to true for all numbers. | [optional] | -| **offnet** | **Boolean** | The offnet field is a boolean representing whether the number is offnet registered or not. This field will be rendered only for requests to the IncomingPhone number resource. | [optional] | -| **tfn** | [**TFN**](TFN.md) | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::IncomingNumberResultAllOf.new( - capabilities: null, - campaign_id: null, - phone_number_id: null, - account_id: null, - application_id: null, - phone_number: null, - _alias: null, - region: null, - country: null, - voice_enabled: null, - sms_enabled: null, - offnet: null, - tfn: null -) -``` - diff --git a/docs/LeaveConferenceWebhook.md b/docs/LeaveConferenceWebhook.md new file mode 100644 index 00000000..c6836231 --- /dev/null +++ b/docs/LeaveConferenceWebhook.md @@ -0,0 +1,34 @@ +# Freeclimb::LeaveConferenceWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be leaveConference - Call has been unbridged from a Conference and its leaveConferenceUrl is being invoked. | [optional] | +| **call_id** | **String** | Unique ID for this Call, generated by FreeClimb. This is the call leg which has left the Conference | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to you and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | This is only populated if request pertains to a Conference. Otherwise, it is set to null. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a Queue. Otherwise, it is set to null. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::LeaveConferenceWebhook.new( + request_type: null, + call_id: null, + account_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null +) +``` + diff --git a/docs/LogListAllOf.md b/docs/LogListAllOf.md deleted file mode 100644 index d603645c..00000000 --- a/docs/LogListAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::LogListAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **logs** | [**Array<LogResult>**](LogResult.md) | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::LogListAllOf.new( - logs: null -) -``` - diff --git a/docs/MachineDetectedWebhook.md b/docs/MachineDetectedWebhook.md new file mode 100644 index 00000000..83f59b69 --- /dev/null +++ b/docs/MachineDetectedWebhook.md @@ -0,0 +1,38 @@ +# Freeclimb::MachineDetectedWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be machineDetected - An outbound call spawned by OutDial was answered by a machine and the ifMachineUrl is being invoked. | [optional] | +| **call_id** | **String** | Unique ID for this Call, generated by FreeClimb. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to you and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | This is only populated if request pertains to a Conference. Otherwise, it is set to null. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a Queue. Otherwise, it is set to null. | [optional] | +| **parent_call_id** | **String** | Call ID of the leg which initiated the OutDial. | [optional] | +| **machine_type** | [**MachineType**](MachineType.md) | | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::MachineDetectedWebhook.new( + request_type: null, + call_id: null, + account_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null, + parent_call_id: null, + machine_type: null +) +``` + diff --git a/docs/MachineType.md b/docs/MachineType.md index faca25b8..ff5775a3 100644 --- a/docs/MachineType.md +++ b/docs/MachineType.md @@ -4,8 +4,8 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **ANSWERING_MACHINE** | **MachineType** | | Represented in Ruby as "answeringMachine" | -| **FAX_MACHINE** | **MachineType** | | Represented in Ruby as "faxMachine" | +| **ANSWERING_MACHINE** | **MachineType** | | Represented in Ruby as "answering machine" | +| **FAX_MODEM** | **MachineType** | | Represented in Ruby as "fax modem" | ## Example diff --git a/docs/MessageDeliveryWebhook.md b/docs/MessageDeliveryWebhook.md new file mode 100644 index 00000000..e64df8ef --- /dev/null +++ b/docs/MessageDeliveryWebhook.md @@ -0,0 +1,36 @@ +# Freeclimb::MessageDeliveryWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Value will be messageDelivery - An SMS message has been received by the platform and is being delivered to the customer application associated with the destination number. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to you and to which this Call is directed (in E.164 format). | [optional] | +| **text** | **String** | Body of the SMS message. | [optional] | +| **direction** | **String** | Value will be inbound to indicate the receipt of a message into the FreeClimb platform. | [optional] | +| **application_id** | **String** | ID of the application to which the destination number is assigned. | [optional] | +| **status** | **String** | Value will be received to indicate that the platform has successfully received the incoming message. | [optional] | +| **phone_number_id** | **String** | ID of the destination phone number. | [optional] | +| **uri** | **String** | The URI for this resource, relative to the API base URL | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::MessageDeliveryWebhook.new( + request_type: null, + account_id: null, + from: null, + to: null, + text: null, + direction: null, + application_id: null, + status: null, + phone_number_id: null, + uri: null +) +``` + diff --git a/docs/MessageRequestAllOf.md b/docs/MessageRequestAllOf.md deleted file mode 100644 index 9b7d6127..00000000 --- a/docs/MessageRequestAllOf.md +++ /dev/null @@ -1,26 +0,0 @@ -# Freeclimb::MessageRequestAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **from** | **String** | Phone number to use as the sender. This must be an incoming phone number that you have purchased from FreeClimb. | | -| **to** | **String** | Phone number to receive the message. Must be within FreeClimb's service area. | | -| **text** | **String** | Text contained in the message (maximum 160 characters). **Note:** For text, only ASCII characters are supported. | | -| **notification_url** | **String** | When the Message changes status, this URL is invoked using HTTP POST with the messageStatus parameters. **Note:** This is a notification only; any PerCL returned is ignored. | [optional] | -| **media_urls** | **Array<String>** | an array of HTTP URLs which are to be used as attachments to the message. This will force the message into being an MMS message and must be done using a from number which is MMS capabile. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::MessageRequestAllOf.new( - from: null, - to: null, - text: null, - notification_url: null, - media_urls: null -) -``` - diff --git a/docs/MessageResultAllOf.md b/docs/MessageResultAllOf.md deleted file mode 100644 index 22f2230c..00000000 --- a/docs/MessageResultAllOf.md +++ /dev/null @@ -1,40 +0,0 @@ -# Freeclimb::MessageResultAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **account_id** | **String** | String that uniquely identifies this account resource. | [optional] | -| **message_id** | **String** | String that uniquely identifies this message resource | [optional] | -| **status** | [**MessageStatus**](MessageStatus.md) | | [optional] | -| **from** | **String** | Phone number in E.164 format that sent the message. | [optional] | -| **to** | **String** | Phone number in E.164 format that received the message. | [optional] | -| **text** | **String** | Message contents | [optional] | -| **direction** | **String** | Noting whether the message was inbound or outbound | [optional] | -| **notification_url** | **String** | URL invoked when message sent | [optional] | -| **brand_id** | **String** | The unique identifier for the brand associated with the message | [optional] | -| **campaign_id** | **String** | The unique identifier for the campaign associated with the message | [optional] | -| **segment_count** | **Float** | The number of segments into which the message was split | [optional] | -| **media_urls** | **Array<String>** | an array of HTTP URLs which were attached this this message | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::MessageResultAllOf.new( - account_id: null, - message_id: null, - status: null, - from: null, - to: null, - text: null, - direction: null, - notification_url: null, - brand_id: null, - campaign_id: null, - segment_count: null, - media_urls: null -) -``` - diff --git a/docs/MessageStatusWebhook.md b/docs/MessageStatusWebhook.md new file mode 100644 index 00000000..62b0ddcc --- /dev/null +++ b/docs/MessageStatusWebhook.md @@ -0,0 +1,38 @@ +# Freeclimb::MessageStatusWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Value will be messageStatus - An outbound SMS has changed status and the Sms command's notificationUrl is being invoked. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **message_id** | **String** | Unique ID for this message, generated by FreeClimb. | [optional] | +| **call_id** | **String** | Unique ID for the Call in the context of which the Sms PerCL command was issued. | [optional] | +| **from** | **String** | aPhone number used to initiate the SMS message (in E.164 format). | [optional] | +| **to** | **String** | Destination number of the SMS message (in E.164 format). | [optional] | +| **text** | **String** | Body of the SMS message. | [optional] | +| **direction** | **String** | Value will be outbound to indicate an outgoing SMS from FreeClimb. | [optional] | +| **application_id** | **String** | ID of the application to which the destination number is assigned. May be null if the originating number is invalid in some way or is not registered to an application. | [optional] | +| **status** | [**MessageStatus**](MessageStatus.md) | | [optional] | +| **phone_number_id** | **String** | ID of the destination phone number. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::MessageStatusWebhook.new( + request_type: null, + account_id: null, + message_id: null, + call_id: null, + from: null, + to: null, + text: null, + direction: null, + application_id: null, + status: null, + phone_number_id: null +) +``` + diff --git a/docs/MessagesListAllOf.md b/docs/MessagesListAllOf.md deleted file mode 100644 index 5d7fa232..00000000 --- a/docs/MessagesListAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::MessagesListAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **messages** | [**Array<MessageResult>**](MessageResult.md) | Array of messages | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::MessagesListAllOf.new( - messages: null -) -``` - diff --git a/docs/OutDialAllOf.md b/docs/OutDialAllOf.md deleted file mode 100644 index ce25300e..00000000 --- a/docs/OutDialAllOf.md +++ /dev/null @@ -1,36 +0,0 @@ -# Freeclimb::OutDialAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **action_url** | **String** | URL to which FreeClimb sends an HTTP POST request. | | -| **call_connect_url** | **String** | URL to which FreeClimb makes an HTTP POST request informing the result of the OutDial. | | -| **calling_number** | **String** | he caller ID to show to the called party when FreeClimb calls. This can be one of the following: The To or From number provided in the first Webhook to your webserver. Any phone number you have purchased from FreeClimb. | | -| **destination** | **String** | E.164 representation of the phone number to Call. | | -| **if_machine** | [**IfMachine**](IfMachine.md) | | [optional] | -| **if_machine_url** | **String** | When the `ifMachine` flag is set to `redirect`, this attribute specifies a URL to which FreeClimb makes a POST request when an answering machine or a fax machine is detected. This URL is required if the `ifMachine` flag is set to `redirect`. Otherwise, it should not be included. | [optional] | -| **send_digits** | **String** | DTMF tones to play to the outdialed Call. This is typically used to dial a number and then dial an extension. | [optional] | -| **status_callback_url** | **String** | When the outdialed Call leg terminates, FreeClimb sends a `callStatus` Webhook to the `statusCallbackUrl`. This is a notification only; any PerCL command returned is ignored. | [optional] | -| **timeout** | **Integer** | Maximum time in seconds the `OutDial` command waits for the called party to answer the Call. When a timeout occurs, FreeClimb invokes the `callConnectUrl` Webhook to report that the out-dialed Call has ended with a status of `noAnswer`. | [optional] | -| **privacy_mode** | **Boolean** | Parameter `privacyMode` will not log the `text` as required by PCI compliance. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::OutDialAllOf.new( - action_url: null, - call_connect_url: null, - calling_number: null, - destination: null, - if_machine: null, - if_machine_url: null, - send_digits: null, - status_callback_url: null, - timeout: null, - privacy_mode: null -) -``` - diff --git a/docs/OutDialApiConnectWebhook.md b/docs/OutDialApiConnectWebhook.md new file mode 100644 index 00000000..f3db3530 --- /dev/null +++ b/docs/OutDialApiConnectWebhook.md @@ -0,0 +1,36 @@ +# Freeclimb::OutDialApiConnectWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be outDialApiConnect - An outbound call spawned by the REST API has connected and the callConnectUrl specified in the API request is being invoked. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **call_id** | **String** | Unique identifier for this Call, generated by FreeClimb | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number or SIP URL of the party that is receiving the call (phone number in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | This is only populated if request pertains to a conference. Otherwise, it is set to null. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a queue. Otherwise, it is set to null. | [optional] | +| **parent_call_id** | **String** | ID of the Call that created this leg (child call). | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::OutDialApiConnectWebhook.new( + request_type: null, + account_id: null, + call_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null, + parent_call_id: null +) +``` + diff --git a/docs/OutDialConnectWebhook.md b/docs/OutDialConnectWebhook.md new file mode 100644 index 00000000..f79cca62 --- /dev/null +++ b/docs/OutDialConnectWebhook.md @@ -0,0 +1,36 @@ +# Freeclimb::OutDialConnectWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be outDialConnect - A Call generated by OutDial has connected and the callConnectUrl is being invoked. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **call_id** | **String** | Unique identifier for this Call, generated by FreeClimb | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number or SIP URL of the party that is receiving the call (phone number in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | This is only populated if request pertains to a conference. Otherwise, it is set to null. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a queue. Otherwise, it is set to null. | [optional] | +| **parent_call_id** | **String** | ID of the Call that created this leg (child call). | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::OutDialConnectWebhook.new( + request_type: null, + account_id: null, + call_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null, + parent_call_id: null +) +``` + diff --git a/docs/OutDialStartWebhook.md b/docs/OutDialStartWebhook.md new file mode 100644 index 00000000..a17b10e8 --- /dev/null +++ b/docs/OutDialStartWebhook.md @@ -0,0 +1,38 @@ +# Freeclimb::OutDialStartWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be outDialStart - The OutDial command has started and the actionUrl is being invoked. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **call_id** | **String** | Unique identifier for this Call, generated by FreeClimb | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to the customer and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | This is only populated if request pertains to a conference. Otherwise, it is set to null. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a queue. Otherwise, it is set to null. | [optional] | +| **dial_call_id** | **String** | ID of the child call that was generated as a result of the Outdial. | [optional] | +| **parent_call_id** | **String** | ID of the Call that created this leg (child call). If this was an inbound call or call created via REST API with no parent, this field will be null. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::OutDialStartWebhook.new( + request_type: null, + account_id: null, + call_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null, + dial_call_id: null, + parent_call_id: null +) +``` + diff --git a/docs/ParkAllOf.md b/docs/ParkAllOf.md deleted file mode 100644 index e32a4a5b..00000000 --- a/docs/ParkAllOf.md +++ /dev/null @@ -1,22 +0,0 @@ -# Freeclimb::ParkAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **wait_url** | **String** | Specifies a URL pointing to a PerCL script containing actions to be executed while the caller is Parked. Once the script returned by the waitUrl runs out of commands to execute, FreeClimb will re-request the waitUrl and start over, essentially looping the script requests indefinitely. | | -| **action_url** | **String** | A request is made to this URL when the Call is resumed, which can occur if the Call is resumed via the Unpark command, the REST API (POST to Call resource), or the caller hangs up. The PerCL script returned in response to the actionUrl will be executed on the resumed call. | | -| **notification_url** | **String** | URL to be invoked when the Call is parked. The request to the URL contains the standard request parameters. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::ParkAllOf.new( - wait_url: null, - action_url: null, - notification_url: null -) -``` - diff --git a/docs/PauseAllOf.md b/docs/PauseAllOf.md deleted file mode 100644 index 6feb8434..00000000 --- a/docs/PauseAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::PauseAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **length** | **Integer** | Length in milliseconds. FreeClimb will wait silently before continuing on. | | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::PauseAllOf.new( - length: null -) -``` - diff --git a/docs/PlayAllOf.md b/docs/PlayAllOf.md deleted file mode 100644 index 78628365..00000000 --- a/docs/PlayAllOf.md +++ /dev/null @@ -1,22 +0,0 @@ -# Freeclimb::PlayAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **file** | **String** | RL of the audio file to be played to the caller. The URL can be the `recordingUrl` generated from the `RecordUtterance` or `StartRecordCall` PerCL commands. | | -| **loop** | **Integer** | Number of times the audio file is played. Specifying '0' causes the Play action to loop until the Call is hung up. | [optional] | -| **privacy_mode** | **Boolean** | Parameter `privacyMode` will not log the `text` as required by PCI compliance. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::PlayAllOf.new( - file: null, - loop: null, - privacy_mode: null -) -``` - diff --git a/docs/PlayEarlyMediaAllOf.md b/docs/PlayEarlyMediaAllOf.md deleted file mode 100644 index 0dd0d95e..00000000 --- a/docs/PlayEarlyMediaAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::PlayEarlyMediaAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **file** | **String** | RL of the audio file to be played to the caller. The URL can be the `recordingUrl` generated from the `RecordUtterance` or `StartRecordCall` PerCL commands or any accessible URL. FreeClimb will respect Cache-Control headers for this file. Use these to limit repeated requests for unchanged audio. If no Cache-Control header is provided, the file will be cached for seven days by default. | | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::PlayEarlyMediaAllOf.new( - file: null -) -``` - diff --git a/docs/QueueListAllOf.md b/docs/QueueListAllOf.md deleted file mode 100644 index 77f64d79..00000000 --- a/docs/QueueListAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::QueueListAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **queues** | [**Array<QueueResult>**](QueueResult.md) | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::QueueListAllOf.new( - queues: null -) -``` - diff --git a/docs/QueueMemberListAllOf.md b/docs/QueueMemberListAllOf.md deleted file mode 100644 index 8ef117a8..00000000 --- a/docs/QueueMemberListAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::QueueMemberListAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **queue_members** | [**Array<QueueMember>**](QueueMember.md) | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::QueueMemberListAllOf.new( - queue_members: null -) -``` - diff --git a/docs/QueueResultAllOf.md b/docs/QueueResultAllOf.md deleted file mode 100644 index cf26da61..00000000 --- a/docs/QueueResultAllOf.md +++ /dev/null @@ -1,30 +0,0 @@ -# Freeclimb::QueueResultAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **account_id** | **String** | ID of the account that created this Queue. | [optional] | -| **queue_id** | **String** | A string that uniquely identifies this Queue resource. | [optional] | -| **_alias** | **String** | A description for this Queue. | [optional] | -| **max_size** | **Integer** | The maximum number of Calls permitted in the Queue. Default is 100. Maximum is 1000. | [optional] | -| **current_size** | **Integer** | Count of Calls currently in the Queue. | [optional] | -| **average_queue_removal_time** | **Integer** | The average amount of time (in seconds) for a call to be removed from the queue. | [optional] | -| **subresource_uris** | **Object** | List of subresources for this Queue (which includes Queue members). | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::QueueResultAllOf.new( - account_id: null, - queue_id: null, - _alias: null, - max_size: null, - current_size: null, - average_queue_removal_time: null, - subresource_uris: null -) -``` - diff --git a/docs/QueueWaitWebhook.md b/docs/QueueWaitWebhook.md new file mode 100644 index 00000000..284e2176 --- /dev/null +++ b/docs/QueueWaitWebhook.md @@ -0,0 +1,40 @@ +# Freeclimb::QueueWaitWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be queueWait - A queued call is requesting instructions to execute during the wait in the queue and the corresponding waitUrl is being invoked. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **call_id** | **String** | Unique identifier for this Call, generated by FreeClimb | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to the customer and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | This is only populated if request pertains to a conference. Otherwise, it is set to null. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a queue. Otherwise, it is set to null. | [optional] | +| **queue_position** | **String** | Current queue position of the enqueued Call. | [optional] | +| **queue_time** | **Integer** | Time (in seconds) the Call spent in the Queue. This is only available if the Call was actually enqueued. | [optional] | +| **current_queue_size** | **Integer** | Current number of enqueued Calls in this Queue. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::QueueWaitWebhook.new( + request_type: null, + account_id: null, + call_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null, + queue_position: null, + queue_time: null, + current_queue_size: null +) +``` + diff --git a/docs/RecordUtteranceAllOf.md b/docs/RecordUtteranceAllOf.md deleted file mode 100644 index 6791c59a..00000000 --- a/docs/RecordUtteranceAllOf.md +++ /dev/null @@ -1,30 +0,0 @@ -# Freeclimb::RecordUtteranceAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **action_url** | **String** | URL to which information on the completed recording is submitted. The PerCL received in response is then used to continue with Call processing. | | -| **silence_timeout_ms** | **Integer** | Interval of silence that should elapse before ending the recording. | [optional] | -| **finish_on_key** | **String** | Key that triggers the end of the recording. any digit, '#', or '*' | [optional] | -| **max_length_sec** | **Integer** | Maximum length for the command execution in seconds. | [optional] | -| **play_beep** | **Boolean** | Indicates whether to play a beep sound before the start of the recording. If set to `false`, no beep is played. | [optional] | -| **auto_start** | **Boolean** | If `false`, recording begins immediately after the RecordUtterance command is processed. If `true`, recording begins when audio is present and if audio begins before the `maxLengthSec` timeout. If no audio begins before `maxLengthSec`, no recording is generated. | [optional] | -| **privacy_mode** | **Boolean** | Parameter `privacyMode` will not log the `text` as required by PCI compliance. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::RecordUtteranceAllOf.new( - action_url: null, - silence_timeout_ms: null, - finish_on_key: null, - max_length_sec: null, - play_beep: null, - auto_start: null, - privacy_mode: null -) -``` - diff --git a/docs/RecordWebhook.md b/docs/RecordWebhook.md new file mode 100644 index 00000000..2ca79d35 --- /dev/null +++ b/docs/RecordWebhook.md @@ -0,0 +1,50 @@ +# Freeclimb::RecordWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | The context or reason why this request is being made. Will be record - The RecordUtterance command has completed and its actionUrl is being invoked. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **call_id** | **String** | Unique identifier for this Call, generated by FreeClimb | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to the customer and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | This is only populated if request pertains to a conference. Otherwise, it is set to null. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a queue. Otherwise, it is set to null. | [optional] | +| **recording_id** | **String** | ID of the recording. | [optional] | +| **recording_url** | **String** | URL of the recorded audio file. This URL can be used as is in a Play command to play the recording (no authentication needed). It can also be used to download a recording file via the REST API. | [optional] | +| **recording_size** | **String** | Size of the recording in bytes | [optional] | +| **recording_format** | **String** | File type of the recording (audio/wav) | [optional] | +| **recording_duration_sec** | **Integer** | Duration of the recorded audio rounded up to the nearest second (in seconds) | [optional] | +| **term_reason** | [**RecordUtteranceTermReason**](RecordUtteranceTermReason.md) | | [optional] | +| **parent_call_id** | **String** | ID of Call that created this leg (child call). | [optional] | +| **privacy_mode** | **Boolean** | If true then it indicates the recording will only be available for download for two minutes prior to it being deleted. This is to minimize risk of anyone else getting access to the url and attempting to access it. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::RecordWebhook.new( + request_type: null, + account_id: null, + call_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null, + recording_id: null, + recording_url: null, + recording_size: null, + recording_format: null, + recording_duration_sec: null, + term_reason: null, + parent_call_id: null, + privacy_mode: null +) +``` + diff --git a/docs/RecordingListAllOf.md b/docs/RecordingListAllOf.md deleted file mode 100644 index 2bbc2934..00000000 --- a/docs/RecordingListAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::RecordingListAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **recordings** | [**Array<RecordingResult>**](RecordingResult.md) | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::RecordingListAllOf.new( - recordings: null -) -``` - diff --git a/docs/RecordingResultAllOf.md b/docs/RecordingResultAllOf.md deleted file mode 100644 index 7df0e81f..00000000 --- a/docs/RecordingResultAllOf.md +++ /dev/null @@ -1,26 +0,0 @@ -# Freeclimb::RecordingResultAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **recording_id** | **String** | String that uniquely identifies this recording resource. | [optional] | -| **account_id** | **String** | ID of the account that created this recording. | [optional] | -| **call_id** | **String** | ID of the Call that was recorded. If a Conference was recorded, this value is empty and the conferenceId property is populated. | [optional] | -| **duration_sec** | **Integer** | Length of the recording in seconds. | [optional] | -| **conference_id** | **String** | ID of the Conference that was recorded. If a Call was recorded, this value is empty and the callId property is populated. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::RecordingResultAllOf.new( - recording_id: null, - account_id: null, - call_id: null, - duration_sec: null, - conference_id: null -) -``` - diff --git a/docs/RedirectAllOf.md b/docs/RedirectAllOf.md deleted file mode 100644 index 92e7b3c6..00000000 --- a/docs/RedirectAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::RedirectAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **action_url** | **String** | URL to request a new PerCL script to continue with the current Call's processing. When `Redirect` invokes the `actionUrl`, an `inbound` Webhook is sent. This request therefore looks identical to the initial request (made to the `voiceUrl` of the number that was called) for an inbound Call. | | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::RedirectAllOf.new( - action_url: null -) -``` - diff --git a/docs/RedirectWebhook.md b/docs/RedirectWebhook.md new file mode 100644 index 00000000..4217ec72 --- /dev/null +++ b/docs/RedirectWebhook.md @@ -0,0 +1,36 @@ +# Freeclimb::RedirectWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be redirect - The Redirect command is executing and its actionUrl is being invoked. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **call_id** | **String** | Unique identifier for this Call, generated by FreeClimb | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to the customer and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | This is only populated if request pertains to a conference. Otherwise, it is set to null. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a queue. Otherwise, it is set to null. | [optional] | +| **parent_call_id** | **String** | ID of Call that created this leg (child call). | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::RedirectWebhook.new( + request_type: null, + account_id: null, + call_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null, + parent_call_id: null +) +``` + diff --git a/docs/RejectAllOf.md b/docs/RejectAllOf.md deleted file mode 100644 index d192a392..00000000 --- a/docs/RejectAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::RejectAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **reason** | **String** | Reason for the rejection. This can be any string value. In general, applications should use a set of enumerated values that are predefined to cover all exit points of the call flows for the given application. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::RejectAllOf.new( - reason: null -) -``` - diff --git a/docs/RemoveFromConferenceAllOf.md b/docs/RemoveFromConferenceAllOf.md deleted file mode 100644 index 3f01c0c8..00000000 --- a/docs/RemoveFromConferenceAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::RemoveFromConferenceAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **call_id** | **String** | ID of the Call leg to be removed from the Conference. The Call must be in a Conference or an error will be triggered. | | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::RemoveFromConferenceAllOf.new( - call_id: null -) -``` - diff --git a/docs/RemoveFromQueueNotificationWebhook.md b/docs/RemoveFromQueueNotificationWebhook.md new file mode 100644 index 00000000..26fc4d7d --- /dev/null +++ b/docs/RemoveFromQueueNotificationWebhook.md @@ -0,0 +1,38 @@ +# Freeclimb::RemoveFromQueueNotificationWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be removeFromQueueNotification - A Call has been removed from a Queue and the Enqueue command’s actionUrl is being invoked. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **call_id** | **String** | Unique identifier for this Call, generated by FreeClimb | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to the customer and to which this Call is directed (in E.164 format). | [optional] | +| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **direction** | [**CallDirection**](CallDirection.md) | | [optional] | +| **conference_id** | **String** | This is only populated if request pertains to a conference. Otherwise, it is set to null. | [optional] | +| **queue_id** | **String** | This is only populated if the request pertains to a queue. Otherwise, it is set to null. | [optional] | +| **queue_result** | [**QueueResultStatus**](QueueResultStatus.md) | | [optional] | +| **queue_time** | **Integer** | Time (in seconds) the Call spent in the Queue. This is only available if the Call was actually enqueued. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: null, + account_id: null, + call_id: null, + from: null, + to: null, + call_status: null, + direction: null, + conference_id: null, + queue_id: null, + queue_result: null, + queue_time: null +) +``` + diff --git a/docs/SMSTenDLCBrand.md b/docs/SMSTenDLCBrand.md index 321811f4..d9111c5e 100644 --- a/docs/SMSTenDLCBrand.md +++ b/docs/SMSTenDLCBrand.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **account_id** | **String** | ID of the account that created this Queue. | [optional] | -| **entity_type** | **String** | Entity type behind the brand. This is the form of business establishment. | | +| **entity_type** | [**SMSTenDLCBrandEntityType**](SMSTenDLCBrandEntityType.md) | | | | **csp_id** | **String** | Unique identifier assigned to the csp by the registry. | [optional][readonly] | | **brand_id** | **String** | Unique identifier assigned to the brand by the registry. | [optional][readonly] | | **first_name** | **String** | First or given name. | [optional] | @@ -22,18 +22,18 @@ | **country** | **String** | ISO2 2 characters country code. Example: US - United States | | | **email** | **String** | Valid email address of brand support contact. | | | **stock_symbol** | **String** | (Required for public company) stock symbol. | [optional] | -| **stock_exchange** | **String** | (Required for public company) stock exchange. | [optional] | +| **stock_exchange** | [**SMSTenDLCBrandStockExchange**](SMSTenDLCBrandStockExchange.md) | | [optional] | | **ip_address** | **String** | IP address of the browser requesting to create brand identity. | [optional] | | **website** | **String** | Brand website URL. | [optional] | -| **brand_relationship** | **String** | Brand relationship to the CSP | | +| **brand_relationship** | [**SMSTenDLCBrandRelationship**](SMSTenDLCBrandRelationship.md) | | | | **vertical** | **String** | Vertical or industry segment of the brand. | | | **alt_business_id** | **String** | Alternate business identifier such as DUNS, LEI, or GIIN | [optional] | -| **alt_business_id_type** | **String** | The type of the Alternative business identifier | [optional] | +| **alt_business_id_type** | [**SMSTenDLCBrandAltBusinessIdType**](SMSTenDLCBrandAltBusinessIdType.md) | | [optional] | | **universal_ein** | **String** | Universal EIN of Brand, Read Only. | [optional][readonly] | | **reference_id** | **String** | Caller supplied brand reference ID. If supplied, the value must be unique across all submitted brands. Can be used to prevent duplicate brand registrations. | [optional] | | **optional_attributes** | **Hash<String, Object>** | Optional brand attributes. Please refer to GET /enum/optionalAttributeNames for dictionary of optional attribute names. | [optional] | | **mock** | **Boolean** | Test brand. | | -| **identity_status** | **String** | TCR assessment of the brand identification status. | | +| **identity_status** | [**SMSTenDLCBrandIdentityStatus**](SMSTenDLCBrandIdentityStatus.md) | | | | **create_date** | **Time** | Unix timestamp when brand was created. | [optional] | ## Example @@ -60,7 +60,7 @@ instance = Freeclimb::SMSTenDLCBrand.new( country: US, email: null, stock_symbol: ABC, - stock_exchange: NASDAQ, + stock_exchange: null, ip_address: null, website: http://www.abcmobile.com, brand_relationship: null, diff --git a/docs/SMSTenDLCBrandAltBusinessIdType.md b/docs/SMSTenDLCBrandAltBusinessIdType.md new file mode 100644 index 00000000..d54734e3 --- /dev/null +++ b/docs/SMSTenDLCBrandAltBusinessIdType.md @@ -0,0 +1,19 @@ +# Freeclimb::SMSTenDLCBrandAltBusinessIdType + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **NONE** | **SMSTenDLCBrandAltBusinessIdType** | | Represented in Ruby as "NONE" | +| **DUNS** | **SMSTenDLCBrandAltBusinessIdType** | | Represented in Ruby as "DUNS" | +| **GIIN** | **SMSTenDLCBrandAltBusinessIdType** | | Represented in Ruby as "GIIN" | +| **LEI** | **SMSTenDLCBrandAltBusinessIdType** | | Represented in Ruby as "LEI" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::SMSTenDLCBrandAltBusinessIdType::[NAME OF ENUM] +``` + diff --git a/docs/SMSTenDLCBrandEntityType.md b/docs/SMSTenDLCBrandEntityType.md new file mode 100644 index 00000000..2a3dc2e3 --- /dev/null +++ b/docs/SMSTenDLCBrandEntityType.md @@ -0,0 +1,20 @@ +# Freeclimb::SMSTenDLCBrandEntityType + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **PRIVATE_PROFIT** | **SMSTenDLCBrandEntityType** | | Represented in Ruby as "PRIVATE_PROFIT" | +| **PUBLIC_PROFIT** | **SMSTenDLCBrandEntityType** | | Represented in Ruby as "PUBLIC_PROFIT" | +| **NON_PROFIT** | **SMSTenDLCBrandEntityType** | | Represented in Ruby as "NON_PROFIT" | +| **GOVERNMENT** | **SMSTenDLCBrandEntityType** | | Represented in Ruby as "GOVERNMENT" | +| **SOLE_PROPRIETOR** | **SMSTenDLCBrandEntityType** | | Represented in Ruby as "SOLE_PROPRIETOR" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::SMSTenDLCBrandEntityType::[NAME OF ENUM] +``` + diff --git a/docs/SMSTenDLCBrandIdentityStatus.md b/docs/SMSTenDLCBrandIdentityStatus.md new file mode 100644 index 00000000..0f141538 --- /dev/null +++ b/docs/SMSTenDLCBrandIdentityStatus.md @@ -0,0 +1,19 @@ +# Freeclimb::SMSTenDLCBrandIdentityStatus + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **SELF_DECLARED** | **SMSTenDLCBrandIdentityStatus** | | Represented in Ruby as "SELF_DECLARED" | +| **UNVERIFIED** | **SMSTenDLCBrandIdentityStatus** | | Represented in Ruby as "UNVERIFIED" | +| **VERIFIED** | **SMSTenDLCBrandIdentityStatus** | | Represented in Ruby as "VERIFIED" | +| **VETTED_VERIFIED** | **SMSTenDLCBrandIdentityStatus** | | Represented in Ruby as "VETTED_VERIFIED" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::SMSTenDLCBrandIdentityStatus::[NAME OF ENUM] +``` + diff --git a/docs/SMSTenDLCBrandRelationship.md b/docs/SMSTenDLCBrandRelationship.md new file mode 100644 index 00000000..b507c14a --- /dev/null +++ b/docs/SMSTenDLCBrandRelationship.md @@ -0,0 +1,20 @@ +# Freeclimb::SMSTenDLCBrandRelationship + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **BASIC_ACCOUNT** | **SMSTenDLCBrandRelationship** | | Represented in Ruby as "BASIC_ACCOUNT" | +| **SMALL_ACCOUNT** | **SMSTenDLCBrandRelationship** | | Represented in Ruby as "SMALL_ACCOUNT" | +| **MEDIUM_ACCOUNT** | **SMSTenDLCBrandRelationship** | | Represented in Ruby as "MEDIUM_ACCOUNT" | +| **LARGE_ACCOUNT** | **SMSTenDLCBrandRelationship** | | Represented in Ruby as "LARGE_ACCOUNT" | +| **KEY_ACCOUNT** | **SMSTenDLCBrandRelationship** | | Represented in Ruby as "KEY_ACCOUNT" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::SMSTenDLCBrandRelationship::[NAME OF ENUM] +``` + diff --git a/docs/SMSTenDLCBrandStockExchange.md b/docs/SMSTenDLCBrandStockExchange.md new file mode 100644 index 00000000..18c6be4a --- /dev/null +++ b/docs/SMSTenDLCBrandStockExchange.md @@ -0,0 +1,42 @@ +# Freeclimb::SMSTenDLCBrandStockExchange + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **NONE** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "NONE" | +| **NASDAQ** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "NASDAQ" | +| **NYSE** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "NYSE" | +| **AMEX** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "AMEX" | +| **AMX** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "AMX" | +| **ASX** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "ASX" | +| **B3** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "B3" | +| **BME** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "BME" | +| **BSE** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "BSE" | +| **FRA** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "FRA" | +| **ICEX** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "ICEX" | +| **JPX** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "JPX" | +| **JSE** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "JSE" | +| **KRX** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "KRX" | +| **LON** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "LON" | +| **NSE** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "NSE" | +| **OMX** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "OMX" | +| **SEHK** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "SEHK" | +| **SGX** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "SGX" | +| **SSE** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "SSE" | +| **STO** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "STO" | +| **SWX** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "SWX" | +| **SZSE** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "SZSE" | +| **TSX** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "TSX" | +| **TWSE** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "TWSE" | +| **VSE** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "VSE" | +| **OTHER** | **SMSTenDLCBrandStockExchange** | | Represented in Ruby as "OTHER" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::SMSTenDLCBrandStockExchange::[NAME OF ENUM] +``` + diff --git a/docs/SMSTenDLCBrandsListResultAllOf.md b/docs/SMSTenDLCBrandsListResultAllOf.md deleted file mode 100644 index 0fd4e877..00000000 --- a/docs/SMSTenDLCBrandsListResultAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::SMSTenDLCBrandsListResultAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **brands** | [**Array<SMSTenDLCBrand>**](SMSTenDLCBrand.md) | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::SMSTenDLCBrandsListResultAllOf.new( - brands: null -) -``` - diff --git a/docs/SMSTenDLCCampaign.md b/docs/SMSTenDLCCampaign.md index 2d18de4a..4009bb4c 100644 --- a/docs/SMSTenDLCCampaign.md +++ b/docs/SMSTenDLCCampaign.md @@ -8,7 +8,7 @@ | **campaign_id** | **String** | Alphanumeric identifier assigned by the registry for a campaign. This identifier is required by the NetNumber OSR SMS enabling process of 10DLC. | | | **csp_id** | **String** | Alphanumeric identifier of the CSP associated with this campaign. | | | **reseller_id** | **String** | Alphanumeric identifier of the reseller that you want to associate with this campaign. | [optional] | -| **status** | **String** | Current campaign status. Possible values: ACTIVE, EXPIRED. A newly created campaign defaults to ACTIVE status. | [optional] | +| **status** | [**SMSTenDLCCampaignStatus**](SMSTenDLCCampaignStatus.md) | | [optional] | | **create_date** | **Time** | Unix timestamp when campaign was created. | [optional] | | **auto_renewal** | **Boolean** | Campaign subscription auto-renewal status. | [optional] | | **billed_date** | **Time** | Campaign recent billed date. | [optional] | diff --git a/docs/SMSTenDLCCampaignStatus.md b/docs/SMSTenDLCCampaignStatus.md new file mode 100644 index 00000000..bf6e5f2f --- /dev/null +++ b/docs/SMSTenDLCCampaignStatus.md @@ -0,0 +1,17 @@ +# Freeclimb::SMSTenDLCCampaignStatus + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **ACTIVE** | **SMSTenDLCCampaignStatus** | | Represented in Ruby as "ACTIVE" | +| **EXPIRED** | **SMSTenDLCCampaignStatus** | | Represented in Ruby as "EXPIRED" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::SMSTenDLCCampaignStatus::[NAME OF ENUM] +``` + diff --git a/docs/SMSTenDLCCampaignsListResultAllOf.md b/docs/SMSTenDLCCampaignsListResultAllOf.md deleted file mode 100644 index 783f7b81..00000000 --- a/docs/SMSTenDLCCampaignsListResultAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::SMSTenDLCCampaignsListResultAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **campaigns** | [**Array<SMSTenDLCCampaign>**](SMSTenDLCCampaign.md) | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::SMSTenDLCCampaignsListResultAllOf.new( - campaigns: null -) -``` - diff --git a/docs/SMSTenDLCPartnerCampaign.md b/docs/SMSTenDLCPartnerCampaign.md index bbca586b..4c94673a 100644 --- a/docs/SMSTenDLCPartnerCampaign.md +++ b/docs/SMSTenDLCPartnerCampaign.md @@ -6,7 +6,7 @@ | ---- | ---- | ----------- | ----- | | **account_id** | **String** | ID of the account that created this Queue. | [optional] | | **campaign_id** | **String** | Alphanumeric identifier assigned by the registry for a campaign. This identifier is required by the NetNumber OSR SMS enabling process of 10DLC. | | -| **status** | **String** | Current campaign status. Possible values: ACTIVE, EXPIRED. A newly created campaign defaults to ACTIVE status. | [optional] | +| **status** | [**SMSTenDLCPartnerCampaignStatus**](SMSTenDLCPartnerCampaignStatus.md) | | [optional] | | **create_date** | **Time** | Unix timestamp when campaign was created. | [optional] | | **brand_id** | **String** | Alphanumeric identifier of the brand associated with this campaign. | | | **usecase** | **String** | Campaign usecase. Must be of defined valid types. Use `/registry/enum/usecase` operation to retrieve usecases available for given brand. | | diff --git a/docs/SMSTenDLCPartnerCampaignStatus.md b/docs/SMSTenDLCPartnerCampaignStatus.md new file mode 100644 index 00000000..2c10559f --- /dev/null +++ b/docs/SMSTenDLCPartnerCampaignStatus.md @@ -0,0 +1,17 @@ +# Freeclimb::SMSTenDLCPartnerCampaignStatus + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **ACTIVE** | **SMSTenDLCPartnerCampaignStatus** | | Represented in Ruby as "ACTIVE" | +| **EXPIRED** | **SMSTenDLCPartnerCampaignStatus** | | Represented in Ruby as "EXPIRED" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::SMSTenDLCPartnerCampaignStatus::[NAME OF ENUM] +``` + diff --git a/docs/SMSTenDLCPartnerCampaignsListResultAllOf.md b/docs/SMSTenDLCPartnerCampaignsListResultAllOf.md deleted file mode 100644 index 37a883dc..00000000 --- a/docs/SMSTenDLCPartnerCampaignsListResultAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::SMSTenDLCPartnerCampaignsListResultAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **partner_campaigns** | [**Array<SMSTenDLCPartnerCampaign>**](SMSTenDLCPartnerCampaign.md) | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::SMSTenDLCPartnerCampaignsListResultAllOf.new( - partner_campaigns: null -) -``` - diff --git a/docs/SMSTollFreeCampaign.md b/docs/SMSTollFreeCampaign.md index 7883ba7b..cf5401af 100644 --- a/docs/SMSTollFreeCampaign.md +++ b/docs/SMSTollFreeCampaign.md @@ -7,7 +7,7 @@ | **account_id** | **String** | ID of the account that created this toll-free campaign | | | **campaign_id** | **String** | Alphanumeric identifier used by the platform to identify this toll-free campaign | | | **use_case** | **String** | | | -| **registration_status** | **String** | Current toll-free campaign registration status.Possible values: UNREGISTERED,INITIATED,PENDING,DECLINED,REGISTERED. A newly created campaign defaults to INITIATED status. | | +| **registration_status** | [**SMSTollFreeCampaignRegistrationStatus**](SMSTollFreeCampaignRegistrationStatus.md) | | | | **date_created** | **String** | | | | **date_updated** | **String** | | | | **revision** | **Integer** | | | diff --git a/docs/SMSTollFreeCampaignRegistrationStatus.md b/docs/SMSTollFreeCampaignRegistrationStatus.md new file mode 100644 index 00000000..bff9261e --- /dev/null +++ b/docs/SMSTollFreeCampaignRegistrationStatus.md @@ -0,0 +1,20 @@ +# Freeclimb::SMSTollFreeCampaignRegistrationStatus + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **UNREGISTERED** | **SMSTollFreeCampaignRegistrationStatus** | | Represented in Ruby as "UNREGISTERED" | +| **INITIATED** | **SMSTollFreeCampaignRegistrationStatus** | | Represented in Ruby as "INITIATED" | +| **PENDING** | **SMSTollFreeCampaignRegistrationStatus** | | Represented in Ruby as "PENDING" | +| **DECLINED** | **SMSTollFreeCampaignRegistrationStatus** | | Represented in Ruby as "DECLINED" | +| **REGISTERED** | **SMSTollFreeCampaignRegistrationStatus** | | Represented in Ruby as "REGISTERED" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::SMSTollFreeCampaignRegistrationStatus::[NAME OF ENUM] +``` + diff --git a/docs/SMSTollFreeCampaignsListResultAllOf.md b/docs/SMSTollFreeCampaignsListResultAllOf.md deleted file mode 100644 index b88aabbf..00000000 --- a/docs/SMSTollFreeCampaignsListResultAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::SMSTollFreeCampaignsListResultAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **brands** | [**Array<SMSTollFreeCampaign>**](SMSTollFreeCampaign.md) | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::SMSTollFreeCampaignsListResultAllOf.new( - brands: null -) -``` - diff --git a/docs/SayAllOf.md b/docs/SayAllOf.md deleted file mode 100644 index f73e163b..00000000 --- a/docs/SayAllOf.md +++ /dev/null @@ -1,24 +0,0 @@ -# Freeclimb::SayAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **text** | **String** | The message to be played to the caller using TTS. The size of the string is limited to 4 KB (or 4,096 bytes). An empty string will cause the command to be skipped. | | -| **language** | **String** | Language and (by implication) the locale to use. This implies the accent and pronunciations to be usde for the TTS. The complete list of valid values for the language attribute is shown below. | [optional] | -| **loop** | **Integer** | Number of times the text is said. Specifying '0' causes the `Say` action to loop until the Call is hung up. | [optional][default to 1] | -| **privacy_mode** | **Boolean** | Parameter `privacyMode` will not log the `text` as required by PCI compliance. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::SayAllOf.new( - text: null, - language: null, - loop: null, - privacy_mode: null -) -``` - diff --git a/docs/SendDigitsAllOf.md b/docs/SendDigitsAllOf.md deleted file mode 100644 index b9ab5575..00000000 --- a/docs/SendDigitsAllOf.md +++ /dev/null @@ -1,22 +0,0 @@ -# Freeclimb::SendDigitsAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **digits** | **String** | String containing the digits to be played. The string cannot be empty and can include any digit, plus `#`, or `*`, and allows embedding specification for delay or pause between the output of individual digits. | | -| **pause_ms** | **Integer** | Pause between digits in milliseconds. Valid values are 100-1000 milliseconds and will be adjusted by FreeClimb to satisfy the constraint. | [optional] | -| **privacy_mode** | **Boolean** | Parameter `privacyMode` will not log the `text` as required by PCI compliance. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::SendDigitsAllOf.new( - digits: null, - pause_ms: null, - privacy_mode: null -) -``` - diff --git a/docs/SetDTMFPassThroughAllOf.md b/docs/SetDTMFPassThroughAllOf.md deleted file mode 100644 index 4f6c4f52..00000000 --- a/docs/SetDTMFPassThroughAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::SetDTMFPassThroughAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **dtmf_pass_through** | **Boolean** | Specifying `false` mutes the Participant's dtmf audio. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::SetDTMFPassThroughAllOf.new( - dtmf_pass_through: null -) -``` - diff --git a/docs/SetListenAllOf.md b/docs/SetListenAllOf.md deleted file mode 100644 index 2d053364..00000000 --- a/docs/SetListenAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::SetListenAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **listen** | **Boolean** | Specifying `false` will silence the Conference for this Participant. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::SetListenAllOf.new( - listen: null -) -``` - diff --git a/docs/SetTalkAllOf.md b/docs/SetTalkAllOf.md deleted file mode 100644 index 7e40091c..00000000 --- a/docs/SetTalkAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::SetTalkAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **talk** | **Boolean** | Specifying `false` mutes the Participant. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::SetTalkAllOf.new( - talk: null -) -``` - diff --git a/docs/SmsAllOf.md b/docs/SmsAllOf.md deleted file mode 100644 index adafc48f..00000000 --- a/docs/SmsAllOf.md +++ /dev/null @@ -1,24 +0,0 @@ -# Freeclimb::SmsAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **to** | **String** | E.164 representation of the phone number to which the message will be sent. Must be within FreeClimb's service area and E.164 formatting (e.g., +18003608245). | | -| **from** | **String** | E.164 representation of the phone number to use as the sender. This must be an incoming phone number you have purchased from FreeClimb. | | -| **text** | **String** | Text contained in the message (maximum 160 characters). | | -| **notification_url** | **String** | When the message changes status, this URL will be invoked using HTTP POST with the messageStatus parameters. This is a notification only; any PerCL returned will be ignored. | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::SmsAllOf.new( - to: null, - from: null, - text: null, - notification_url: null -) -``` - diff --git a/docs/TerminateConferenceAllOf.md b/docs/TerminateConferenceAllOf.md deleted file mode 100644 index 06b56601..00000000 --- a/docs/TerminateConferenceAllOf.md +++ /dev/null @@ -1,18 +0,0 @@ -# Freeclimb::TerminateConferenceAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **conference_id** | **String** | ID of the conference to terminate. | | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::TerminateConferenceAllOf.new( - conference_id: null -) -``` - diff --git a/docs/TranscribeReason.md b/docs/TranscribeReason.md new file mode 100644 index 00000000..ee12ffd8 --- /dev/null +++ b/docs/TranscribeReason.md @@ -0,0 +1,20 @@ +# Freeclimb::TranscribeReason + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **INTERNAL_ERROR** | **TranscribeReason** | | Represented in Ruby as "internalError" | +| **HANGUP** | **TranscribeReason** | | Represented in Ruby as "hangup" | +| **MAX_LENGTH** | **TranscribeReason** | | Represented in Ruby as "maxLength" | +| **DIGIT** | **TranscribeReason** | | Represented in Ruby as "digit" | +| **NO_INPUT** | **TranscribeReason** | | Represented in Ruby as "noInput" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::TranscribeReason::[NAME OF ENUM] +``` + diff --git a/docs/TranscribeTermReason.md b/docs/TranscribeTermReason.md new file mode 100644 index 00000000..23c4c3b0 --- /dev/null +++ b/docs/TranscribeTermReason.md @@ -0,0 +1,17 @@ +# Freeclimb::TranscribeTermReason + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **ERROR** | **TranscribeTermReason** | | Represented in Ruby as "error" | +| **COMPLETED** | **TranscribeTermReason** | | Represented in Ruby as "completed" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::TranscribeTermReason::[NAME OF ENUM] +``` + diff --git a/docs/TranscribeUtterance.md b/docs/TranscribeUtterance.md index c347306f..65d8f64b 100644 --- a/docs/TranscribeUtterance.md +++ b/docs/TranscribeUtterance.md @@ -6,10 +6,10 @@ | ---- | ---- | ----------- | ----- | | **action_url** | **String** | | | | **play_beep** | **Boolean** | | [optional][default to false] | -| **record** | [**TranscribeUtteranceAllOfRecord**](TranscribeUtteranceAllOfRecord.md) | | [optional] | +| **record** | [**TranscribeUtteranceRecord**](TranscribeUtteranceRecord.md) | | [optional] | | **privacy_for_logging** | **Boolean** | | [optional][default to false] | | **privacy_for_recording** | **Boolean** | | [optional][default to false] | -| **prompts** | **Array<Object>** | | [optional] | +| **prompts** | [**Array<PerclCommand>**](PerclCommand.md) | | [optional] | ## Example diff --git a/docs/TranscribeUtteranceAllOf.md b/docs/TranscribeUtteranceAllOf.md deleted file mode 100644 index 7d45c157..00000000 --- a/docs/TranscribeUtteranceAllOf.md +++ /dev/null @@ -1,28 +0,0 @@ -# Freeclimb::TranscribeUtteranceAllOf - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **action_url** | **String** | | | -| **play_beep** | **Boolean** | | [optional][default to false] | -| **record** | [**TranscribeUtteranceAllOfRecord**](TranscribeUtteranceAllOfRecord.md) | | [optional] | -| **privacy_for_logging** | **Boolean** | | [optional][default to false] | -| **privacy_for_recording** | **Boolean** | | [optional][default to false] | -| **prompts** | **Array<Object>** | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::TranscribeUtteranceAllOf.new( - action_url: null, - play_beep: null, - record: null, - privacy_for_logging: null, - privacy_for_recording: null, - prompts: null -) -``` - diff --git a/docs/TranscribeUtteranceAllOfRecord.md b/docs/TranscribeUtteranceAllOfRecord.md deleted file mode 100644 index 313c2628..00000000 --- a/docs/TranscribeUtteranceAllOfRecord.md +++ /dev/null @@ -1,22 +0,0 @@ -# Freeclimb::TranscribeUtteranceAllOfRecord - -## Properties - -| Name | Type | Description | Notes | -| ---- | ---- | ----------- | ----- | -| **save_recording** | **Boolean** | | [optional][default to false] | -| **max_length_sec** | **Integer** | | [optional][default to 60] | -| **rcrd_termination_silence_time_ms** | **Integer** | | [optional] | - -## Example - -```ruby -require 'freeclimb' - -instance = Freeclimb::TranscribeUtteranceAllOfRecord.new( - save_recording: null, - max_length_sec: null, - rcrd_termination_silence_time_ms: null -) -``` - diff --git a/docs/TranscribeWebhook.md b/docs/TranscribeWebhook.md new file mode 100644 index 00000000..2a995c7c --- /dev/null +++ b/docs/TranscribeWebhook.md @@ -0,0 +1,62 @@ +# Freeclimb::TranscribeWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | The context or reason why this request is being made. Will be transcribe - The TranscribeUtterance command has completed and its actionUrl is being invoked. | [optional] | +| **account_id** | **String** | Account ID associated with your account. | [optional] | +| **call_id** | **String** | Unique identifier for this Call, generated by FreeClimb | [optional] | +| **from** | **String** | Phone number of the party that initiated the Call (in E.164 format). | [optional] | +| **to** | **String** | Phone number provisioned to the customer and to which this Call is directed (in E.164 format). | [optional] | +| **recording_id** | **String** | The ID of the recording. If no recording was made due to errors or the 'saveRecording' flag being disabled this field will be set to null. | [optional] | +| **recording_url** | **String** | The URL of the recorded audio file. This URL can be used as is in a Play command to play the recording (no authentication needed). It can also be used to download the recording file via the REST API. | [optional] | +| **recording_size** | **Integer** | The size of the recording in bytes. | [optional] | +| **recording_format** | **String** | The media type of the recording. | [optional] | +| **recording_duration_ms** | **Integer** | The duration of the recorded audio in milliseconds. | [optional] | +| **term_reason** | [**TranscribeTermReason**](TranscribeTermReason.md) | | [optional] | +| **record_term_reason** | [**RecordUtteranceTermReason**](RecordUtteranceTermReason.md) | | [optional] | +| **digit** | **String** | If recordTermReason is digit, this will be the digit that was pressed. Otherwise it will be null. | [optional] | +| **privacy_for_logging** | **Boolean** | Echo back of the privacyForLogging flag as specified in the transcribe utterance command – confirmation of logging protection has been applied. Can be used by application to know it should also apply protection when handling this request. | [optional] | +| **privacy_for_recording** | **Boolean** | Echo back of the privacyForRecording flag as specified in the transcribe utterance command – confirmation of logging protection has been applied. Can be used by application to know it should also apply protection when handling this request. | [optional] | +| **barge_in_reason** | [**BargeInReason**](BargeInReason.md) | | [optional] | +| **barged_in_prompt_no** | **Integer** | | [optional] | +| **barged_in_prompt_ms** | **Integer** | duration in ms bargedInPromptNo prompt was executing until barge-in occurred. | [optional] | +| **barged_in_prompt_loop_no** | **Integer** | | [optional] | +| **barge_in_time_ms** | **Integer** | epoch time in ms | [optional] | +| **transcript** | **String** | Transcribed text of the recording. Can be empty or null. null means there was a failure in transcribing the audio, refer to transcribeReason for detailed failure reason. | [optional] | +| **transcribe_reason** | [**TranscribeReason**](TranscribeReason.md) | | [optional] | +| **transcription_duration_ms** | **Integer** | The duration of the audio being transcribed in milliseconds | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::TranscribeWebhook.new( + request_type: null, + account_id: null, + call_id: null, + from: null, + to: null, + recording_id: null, + recording_url: null, + recording_size: null, + recording_format: null, + recording_duration_ms: null, + term_reason: null, + record_term_reason: null, + digit: null, + privacy_for_logging: null, + privacy_for_recording: null, + barge_in_reason: null, + barged_in_prompt_no: null, + barged_in_prompt_ms: null, + barged_in_prompt_loop_no: null, + barge_in_time_ms: null, + transcript: null, + transcribe_reason: null, + transcription_duration_ms: null +) +``` + diff --git a/docs/UpdateConferenceRequest.md b/docs/UpdateConferenceRequest.md index 35447afc..6a805562 100644 --- a/docs/UpdateConferenceRequest.md +++ b/docs/UpdateConferenceRequest.md @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **_alias** | **String** | Description for this conference. Maximum 64 characters. | [optional] | -| **play_beep** | [**PlayBeep**](PlayBeep.md) | | [optional][default to 'always'] | +| **play_beep** | [**PlayBeep**](PlayBeep.md) | | [optional] | | **status** | [**UpdateConferenceRequestStatus**](UpdateConferenceRequestStatus.md) | | [optional] | ## Example diff --git a/docs/Webhook.md b/docs/Webhook.md new file mode 100644 index 00000000..7a6c0cd2 --- /dev/null +++ b/docs/Webhook.md @@ -0,0 +1,18 @@ +# Freeclimb::Webhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Type of webhook request | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::Webhook.new( + request_type: null +) +``` + diff --git a/freeclimb.gemspec b/freeclimb.gemspec index 83a4ba03..05e20988 100644 --- a/freeclimb.gemspec +++ b/freeclimb.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb.rb b/lib/freeclimb.rb index 5fdc6e92..1af48f6e 100644 --- a/lib/freeclimb.rb +++ b/lib/freeclimb.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -19,141 +19,132 @@ # Models require 'freeclimb/models/account_request' require 'freeclimb/models/account_result' -require 'freeclimb/models/account_result_all_of' require 'freeclimb/models/account_status' require 'freeclimb/models/account_type' -require 'freeclimb/models/add_to_conference_all_of' require 'freeclimb/models/answered_by' require 'freeclimb/models/application_list' -require 'freeclimb/models/application_list_all_of' require 'freeclimb/models/application_request' require 'freeclimb/models/application_result' -require 'freeclimb/models/application_result_all_of' require 'freeclimb/models/available_number' require 'freeclimb/models/available_number_list' -require 'freeclimb/models/available_number_list_all_of' +require 'freeclimb/models/barge_in_reason' require 'freeclimb/models/buy_incoming_number_request' require 'freeclimb/models/call_direction' +require 'freeclimb/models/call_ended_reason' require 'freeclimb/models/call_list' -require 'freeclimb/models/call_list_all_of' require 'freeclimb/models/call_result' -require 'freeclimb/models/call_result_all_of' require 'freeclimb/models/call_status' require 'freeclimb/models/capabilities' require 'freeclimb/models/completion_request' require 'freeclimb/models/completion_result' +require 'freeclimb/models/completion_result_status' require 'freeclimb/models/conference_list' -require 'freeclimb/models/conference_list_all_of' require 'freeclimb/models/conference_participant_list' -require 'freeclimb/models/conference_participant_list_all_of' require 'freeclimb/models/conference_participant_result' -require 'freeclimb/models/conference_participant_result_all_of' require 'freeclimb/models/conference_result' -require 'freeclimb/models/conference_result_all_of' require 'freeclimb/models/conference_status' -require 'freeclimb/models/create_conference_all_of' require 'freeclimb/models/create_conference_request' require 'freeclimb/models/create_web_rtc_token' -require 'freeclimb/models/enqueue_all_of' require 'freeclimb/models/filter_logs_request' -require 'freeclimb/models/get_digits_all_of' -require 'freeclimb/models/get_speech_all_of' +require 'freeclimb/models/get_digits_reason' require 'freeclimb/models/get_speech_reason' require 'freeclimb/models/grammar_file_built_in' require 'freeclimb/models/grammar_type' -require 'freeclimb/models/hangup_all_of' require 'freeclimb/models/if_machine' require 'freeclimb/models/incoming_number_list' -require 'freeclimb/models/incoming_number_list_all_of' require 'freeclimb/models/incoming_number_request' require 'freeclimb/models/incoming_number_result' -require 'freeclimb/models/incoming_number_result_all_of' require 'freeclimb/models/language' require 'freeclimb/models/log_level' require 'freeclimb/models/log_list' -require 'freeclimb/models/log_list_all_of' require 'freeclimb/models/log_result' require 'freeclimb/models/machine_type' require 'freeclimb/models/make_call_request' require 'freeclimb/models/message_direction' require 'freeclimb/models/message_request' -require 'freeclimb/models/message_request_all_of' require 'freeclimb/models/message_result' -require 'freeclimb/models/message_result_all_of' require 'freeclimb/models/message_status' require 'freeclimb/models/messages_list' -require 'freeclimb/models/messages_list_all_of' require 'freeclimb/models/mutable_resource_model' -require 'freeclimb/models/out_dial_all_of' require 'freeclimb/models/pagination_model' -require 'freeclimb/models/park_all_of' -require 'freeclimb/models/pause_all_of' require 'freeclimb/models/percl_command' require 'freeclimb/models/percl_script' -require 'freeclimb/models/play_all_of' require 'freeclimb/models/play_beep' -require 'freeclimb/models/play_early_media_all_of' require 'freeclimb/models/queue_list' -require 'freeclimb/models/queue_list_all_of' require 'freeclimb/models/queue_member' require 'freeclimb/models/queue_member_list' -require 'freeclimb/models/queue_member_list_all_of' require 'freeclimb/models/queue_request' require 'freeclimb/models/queue_result' -require 'freeclimb/models/queue_result_all_of' require 'freeclimb/models/queue_result_status' -require 'freeclimb/models/record_utterance_all_of' require 'freeclimb/models/record_utterance_term_reason' require 'freeclimb/models/recording_list' -require 'freeclimb/models/recording_list_all_of' require 'freeclimb/models/recording_result' -require 'freeclimb/models/recording_result_all_of' -require 'freeclimb/models/redirect_all_of' -require 'freeclimb/models/reject_all_of' require 'freeclimb/models/request_type' require 'freeclimb/models/sms_ten_dlc_brand' +require 'freeclimb/models/sms_ten_dlc_brand_alt_business_id_type' +require 'freeclimb/models/sms_ten_dlc_brand_entity_type' +require 'freeclimb/models/sms_ten_dlc_brand_identity_status' +require 'freeclimb/models/sms_ten_dlc_brand_relationship' +require 'freeclimb/models/sms_ten_dlc_brand_stock_exchange' require 'freeclimb/models/sms_ten_dlc_brands_list_result' -require 'freeclimb/models/sms_ten_dlc_brands_list_result_all_of' require 'freeclimb/models/sms_ten_dlc_campaign' +require 'freeclimb/models/sms_ten_dlc_campaign_status' require 'freeclimb/models/sms_ten_dlc_campaigns_list_result' -require 'freeclimb/models/sms_ten_dlc_campaigns_list_result_all_of' require 'freeclimb/models/sms_ten_dlc_partner_campaign' require 'freeclimb/models/sms_ten_dlc_partner_campaign_brand' +require 'freeclimb/models/sms_ten_dlc_partner_campaign_status' require 'freeclimb/models/sms_ten_dlc_partner_campaigns_list_result' -require 'freeclimb/models/sms_ten_dlc_partner_campaigns_list_result_all_of' require 'freeclimb/models/sms_toll_free_campaign' +require 'freeclimb/models/sms_toll_free_campaign_registration_status' require 'freeclimb/models/sms_toll_free_campaigns_list_result' -require 'freeclimb/models/sms_toll_free_campaigns_list_result_all_of' -require 'freeclimb/models/say_all_of' -require 'freeclimb/models/send_digits_all_of' -require 'freeclimb/models/set_dtmf_pass_through_all_of' -require 'freeclimb/models/set_listen_all_of' -require 'freeclimb/models/set_talk_all_of' -require 'freeclimb/models/sms_all_of' require 'freeclimb/models/tfn' -require 'freeclimb/models/transcribe_utterance_all_of' -require 'freeclimb/models/transcribe_utterance_all_of_record' +require 'freeclimb/models/transcribe_reason' +require 'freeclimb/models/transcribe_term_reason' +require 'freeclimb/models/transcribe_utterance_record' require 'freeclimb/models/update_call_request' require 'freeclimb/models/update_call_request_status' require 'freeclimb/models/update_conference_participant_request' require 'freeclimb/models/update_conference_request' require 'freeclimb/models/update_conference_request_status' +require 'freeclimb/models/webhook' require 'freeclimb/models/add_to_conference' +require 'freeclimb/models/add_to_conference_notification_webhook' +require 'freeclimb/models/add_to_queue_notification_webhook' +require 'freeclimb/models/call_control_webhook' +require 'freeclimb/models/call_status_webhook' +require 'freeclimb/models/conference_recording_status_webhook' +require 'freeclimb/models/conference_status_webhook' require 'freeclimb/models/create_conference' +require 'freeclimb/models/create_conference_webhook' require 'freeclimb/models/dequeue' +require 'freeclimb/models/dequeue_webhook' require 'freeclimb/models/enqueue' require 'freeclimb/models/get_digits' +require 'freeclimb/models/get_digits_webhook' require 'freeclimb/models/get_speech' +require 'freeclimb/models/get_speech_webhook' require 'freeclimb/models/hangup' +require 'freeclimb/models/inbound_call_webhook' +require 'freeclimb/models/leave_conference_webhook' +require 'freeclimb/models/machine_detected_webhook' +require 'freeclimb/models/message_delivery_webhook' +require 'freeclimb/models/message_status_webhook' require 'freeclimb/models/out_dial' +require 'freeclimb/models/out_dial_api_connect_webhook' +require 'freeclimb/models/out_dial_connect_webhook' +require 'freeclimb/models/out_dial_start_webhook' require 'freeclimb/models/park' require 'freeclimb/models/pause' require 'freeclimb/models/play' require 'freeclimb/models/play_early_media' +require 'freeclimb/models/queue_wait_webhook' require 'freeclimb/models/record_utterance' +require 'freeclimb/models/record_webhook' require 'freeclimb/models/redirect' +require 'freeclimb/models/redirect_webhook' require 'freeclimb/models/reject' require 'freeclimb/models/remove_from_conference' +require 'freeclimb/models/remove_from_queue_notification_webhook' require 'freeclimb/models/say' require 'freeclimb/models/send_digits' require 'freeclimb/models/set_dtmf_pass_through' @@ -163,12 +154,13 @@ require 'freeclimb/models/start_record_call' require 'freeclimb/models/terminate_conference' require 'freeclimb/models/transcribe_utterance' +require 'freeclimb/models/transcribe_webhook' require 'freeclimb/models/unpark' # APIs require 'freeclimb/api/default_api' -#Utils +# Utils require 'freeclimb/utils/signature_information' require 'freeclimb/utils/request_verifier' diff --git a/lib/freeclimb/api/default_api.rb b/lib/freeclimb/api/default_api.rb index 9fbf2aa4..e12c83c3 100644 --- a/lib/freeclimb/api/default_api.rb +++ b/lib/freeclimb/api/default_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -59,7 +59,7 @@ def buy_a_phone_number_with_http_info(buy_incoming_number_request, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -121,7 +121,7 @@ def create_a_conference_with_http_info(opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -183,7 +183,7 @@ def create_a_queue_with_http_info(opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -245,7 +245,7 @@ def create_an_application_with_http_info(opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -314,7 +314,7 @@ def create_knowledge_base_completion_with_http_info(knowledge_base_id, opts = {} # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -754,7 +754,7 @@ def filter_logs_with_http_info(filter_logs_request, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -2959,7 +2959,7 @@ def make_a_call_with_http_info(opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -3026,7 +3026,7 @@ def make_a_webrtc_jwt_with_http_info(create_web_rtc_token, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -3160,7 +3160,7 @@ def send_an_sms_message_with_http_info(message_request, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -3289,7 +3289,7 @@ def update_a_conference_with_http_info(conference_id, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -3361,7 +3361,7 @@ def update_a_live_call_with_http_info(call_id, update_call_request, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -3437,7 +3437,7 @@ def update_a_participant_with_http_info(conference_id, call_id, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -3506,7 +3506,7 @@ def update_a_queue_with_http_info(queue_id, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -3566,7 +3566,7 @@ def update_an_account_with_http_info(opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -3635,7 +3635,7 @@ def update_an_application_with_http_info(application_id, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -3704,7 +3704,7 @@ def update_an_incoming_number_with_http_info(phone_number_id, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters @@ -3757,7 +3757,7 @@ def get_next_page_with_http_info(response, opts = {}) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? - header_params['Content-Type'] = content_type + header_params['Content-Type'] = content_type end # form parameters diff --git a/lib/freeclimb/api_client.rb b/lib/freeclimb/api_client.rb index 9f5bf1f7..f4e87e70 100644 --- a/lib/freeclimb/api_client.rb +++ b/lib/freeclimb/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/api_error.rb b/lib/freeclimb/api_error.rb index c6a18a3e..5106037d 100644 --- a/lib/freeclimb/api_error.rb +++ b/lib/freeclimb/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/configuration.rb b/lib/freeclimb/configuration.rb index 5b9dcfbf..b0f8318a 100644 --- a/lib/freeclimb/configuration.rb +++ b/lib/freeclimb/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -273,6 +273,5 @@ def server_url(index, variables = {}, servers = nil) url end - end end diff --git a/lib/freeclimb/models/account_request.rb b/lib/freeclimb/models/account_request.rb index 388dbf34..06ad9b01 100644 --- a/lib/freeclimb/models/account_request.rb +++ b/lib/freeclimb/models/account_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -228,7 +228,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/account_result.rb b/lib/freeclimb/models/account_result.rb index a24f992b..f78d41d8 100644 --- a/lib/freeclimb/models/account_result.rb +++ b/lib/freeclimb/models/account_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -46,6 +46,28 @@ class AccountResult # The list of subresources for this account. attr_accessor :subresource_uris + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -101,7 +123,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'AccountResultAllOf', :'MutableResourceModel' ] end @@ -331,7 +352,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/account_result_all_of.rb b/lib/freeclimb/models/account_result_all_of.rb deleted file mode 100644 index 36eced8c..00000000 --- a/lib/freeclimb/models/account_result_all_of.rb +++ /dev/null @@ -1,289 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class AccountResultAllOf - # String that uniquely identifies this account resource. - attr_accessor :account_id - - # The API key assigned to this account. This key must be kept a secret by the customer. - attr_accessor :api_key - - # A description for this account. - attr_accessor :_alias - - # A string that identifies a category or group to which the account belongs. - attr_accessor :label - - attr_accessor :type - - attr_accessor :status - - # The list of subresources for this account. - attr_accessor :subresource_uris - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'accountId', - :'api_key' => :'apiKey', - :'_alias' => :'alias', - :'label' => :'label', - :'type' => :'type', - :'status' => :'status', - :'subresource_uris' => :'subresourceUris' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'api_key' => :'String', - :'_alias' => :'String', - :'label' => :'String', - :'type' => :'AccountType', - :'status' => :'AccountStatus', - :'subresource_uris' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_id', - :'api_key', - :'_alias', - :'label', - :'type', - :'status', - :'subresource_uris' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::AccountResultAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::AccountResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'api_key') - self.api_key = attributes[:'api_key'] - end - - if attributes.key?(:'_alias') - self._alias = attributes[:'_alias'] - end - - if attributes.key?(:'label') - self.label = attributes[:'label'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'subresource_uris') - self.subresource_uris = attributes[:'subresource_uris'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @account_id.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - api_key == o.api_key && - _alias == o._alias && - label == o.label && - type == o.type && - status == o.status && - subresource_uris == o.subresource_uris - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, api_key, _alias, label, type, status, subresource_uris].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/account_status.rb b/lib/freeclimb/models/account_status.rb index e889cfad..1653b8dc 100644 --- a/lib/freeclimb/models/account_status.rb +++ b/lib/freeclimb/models/account_status.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/account_type.rb b/lib/freeclimb/models/account_type.rb index e8ead735..45de81e1 100644 --- a/lib/freeclimb/models/account_type.rb +++ b/lib/freeclimb/models/account_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/add_to_conference.rb b/lib/freeclimb/models/add_to_conference.rb index bfedba6e..7343e7ce 100644 --- a/lib/freeclimb/models/add_to_conference.rb +++ b/lib/freeclimb/models/add_to_conference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -92,7 +92,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'AddToConferenceAllOf', :'PerclCommand' ] end @@ -326,7 +325,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/add_to_conference_all_of.rb b/lib/freeclimb/models/add_to_conference_all_of.rb deleted file mode 100644 index 00caf343..00000000 --- a/lib/freeclimb/models/add_to_conference_all_of.rb +++ /dev/null @@ -1,318 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class AddToConferenceAllOf - # If `true`, Call control will be enabled for this Participant's Call leg. - attr_accessor :allow_call_control - - # Defines a sequence of digits that, when entered by this caller, invokes the `callControlUrl`. Only digits plus '*', and '#' may be used. - attr_accessor :call_control_sequence - - # URL to be invoked when this Participant enters the digit sequence defined in the `callControlSequence` attribute. - attr_accessor :call_control_url - - # ID of the Conference to which to add the Participant (Call leg). Conference must exist or an error will result. - attr_accessor :conference_id - - # URL to be invoked when the Participant leaves the Conference. - attr_accessor :leave_conference_url - - # If `true`, the Participant joins the Conference with listen privileges. This may be modified later via the REST API or `SetListen` PerCL command. - attr_accessor :listen - - # When the Participant enters the Conference, this URL will be invoked using an HTTP POST request with the standard request parameters. - attr_accessor :notification_url - - # Flag that indicates whether a Conference starts upon entry of this particular Participant. This is usually set to `true` for moderators and `false` for all other Participants. - attr_accessor :start_conf_on_enter - - # If `true`, the Participant joins the Conference with talk privileges. This may be modified later via the REST API or `SetTalk` PerCL command. - attr_accessor :talk - - # If `true`, the Participant joins the Conference with dtmfPassThrough privileges. This may be modified later via the REST API or `SetDTMFPassThrough` PerCL command. - attr_accessor :dtmf_pass_through - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'allow_call_control' => :'allowCallControl', - :'call_control_sequence' => :'callControlSequence', - :'call_control_url' => :'callControlUrl', - :'conference_id' => :'conferenceId', - :'leave_conference_url' => :'leaveConferenceUrl', - :'listen' => :'listen', - :'notification_url' => :'notificationUrl', - :'start_conf_on_enter' => :'startConfOnEnter', - :'talk' => :'talk', - :'dtmf_pass_through' => :'dtmfPassThrough' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'allow_call_control' => :'Boolean', - :'call_control_sequence' => :'String', - :'call_control_url' => :'String', - :'conference_id' => :'String', - :'leave_conference_url' => :'String', - :'listen' => :'Boolean', - :'notification_url' => :'String', - :'start_conf_on_enter' => :'Boolean', - :'talk' => :'Boolean', - :'dtmf_pass_through' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::AddToConferenceAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::AddToConferenceAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'allow_call_control') - self.allow_call_control = attributes[:'allow_call_control'] - end - - if attributes.key?(:'call_control_sequence') - self.call_control_sequence = attributes[:'call_control_sequence'] - end - - if attributes.key?(:'call_control_url') - self.call_control_url = attributes[:'call_control_url'] - end - - if attributes.key?(:'conference_id') - self.conference_id = attributes[:'conference_id'] - end - - if attributes.key?(:'leave_conference_url') - self.leave_conference_url = attributes[:'leave_conference_url'] - end - - if attributes.key?(:'listen') - self.listen = attributes[:'listen'] - end - - if attributes.key?(:'notification_url') - self.notification_url = attributes[:'notification_url'] - end - - if attributes.key?(:'start_conf_on_enter') - self.start_conf_on_enter = attributes[:'start_conf_on_enter'] - end - - if attributes.key?(:'talk') - self.talk = attributes[:'talk'] - end - - if attributes.key?(:'dtmf_pass_through') - self.dtmf_pass_through = attributes[:'dtmf_pass_through'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @conference_id.nil? - invalid_properties.push('invalid value for "conference_id", conference_id cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @allow_call_control.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - allow_call_control == o.allow_call_control && - call_control_sequence == o.call_control_sequence && - call_control_url == o.call_control_url && - conference_id == o.conference_id && - leave_conference_url == o.leave_conference_url && - listen == o.listen && - notification_url == o.notification_url && - start_conf_on_enter == o.start_conf_on_enter && - talk == o.talk && - dtmf_pass_through == o.dtmf_pass_through - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [allow_call_control, call_control_sequence, call_control_url, conference_id, leave_conference_url, listen, notification_url, start_conf_on_enter, talk, dtmf_pass_through].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/add_to_conference_notification_webhook.rb b/lib/freeclimb/models/add_to_conference_notification_webhook.rb new file mode 100644 index 00000000..653f83c6 --- /dev/null +++ b/lib/freeclimb/models/add_to_conference_notification_webhook.rb @@ -0,0 +1,384 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + # A Call has been bridged to a Conference and the AddToConference command’s notificationUrl is being invoked. This is a notification only; any PerCL returned will be ignored. + class AddToConferenceNotificationWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + AddToConferenceNotificationWebhook.new(hash) + end + # Context or reason why this request is being made. Will be addToConferenceNotification - A Call has been bridged to a conference and the addToConference command’s notificationUrl is being invoked. + attr_accessor :request_type + + # Unique ID for this Call, generated by FreeClimb. + attr_accessor :call_id + + # Account ID associated with your account. + attr_accessor :account_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number provisioned to you and to which this Call is directed (in E.164 format). + attr_accessor :to + + attr_accessor :call_status + + attr_accessor :direction + + # Unique ID of the Conference. + attr_accessor :conference_id + + # This is only populated if the request pertains to a Queue. Otherwise, it is set to null. + attr_accessor :queue_id + + attr_accessor :status + + # URL of the Conference’s recorded audio. Populated only if a Recording exists and the Conference was emptied. + attr_accessor :recording_url + + # Unique ID of the Recording from this Conference. Populated only if a recording exists and the Conference was emptied. + attr_accessor :recording_id + + # Duration of the recorded audio (in seconds), rounded up to the nearest second. Populated only if a Recording exists and the Conference was emptied. + attr_accessor :recording_duration_sec + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'call_id' => :'callId', + :'account_id' => :'accountId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId', + :'status' => :'status', + :'recording_url' => :'recordingUrl', + :'recording_id' => :'recordingId', + :'recording_duration_sec' => :'recordingDurationSec' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'call_id' => :'String', + :'account_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String', + :'status' => :'ConferenceStatus', + :'recording_url' => :'String', + :'recording_id' => :'String', + :'recording_duration_sec' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_status', + :'direction', + :'queue_id', + :'status', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::AddToConferenceNotificationWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::AddToConferenceNotificationWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'recording_url') + self.recording_url = attributes[:'recording_url'] + end + + if attributes.key?(:'recording_id') + self.recording_id = attributes[:'recording_id'] + end + + if attributes.key?(:'recording_duration_sec') + self.recording_duration_sec = attributes[:'recording_duration_sec'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + call_id == o.call_id && + account_id == o.account_id && + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && + status == o.status && + recording_url == o.recording_url && + recording_id == o.recording_id && + recording_duration_sec == o.recording_duration_sec && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, call_id, account_id, from, to, call_status, direction, conference_id, queue_id, status, recording_url, recording_id, recording_duration_sec].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/conference_participant_result_all_of.rb b/lib/freeclimb/models/add_to_queue_notification_webhook.rb similarity index 65% rename from lib/freeclimb/models/conference_participant_result_all_of.rb rename to lib/freeclimb/models/add_to_queue_notification_webhook.rb index 56c8520c..fbd2fb7a 100644 --- a/lib/freeclimb/models/conference_participant_result_all_of.rb +++ b/lib/freeclimb/models/add_to_queue_notification_webhook.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -14,120 +14,172 @@ require 'time' module Freeclimb - class ConferenceParticipantResultAllOf - # ID of the account that created this participant. + # A Call has been added to a Queue and the Enqueue command’s notificationUrl is being invoked. This is a notification only; any PerCL returned will be ignored. + class AddToQueueNotificationWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + AddToQueueNotificationWebhook.new(hash) + end + # Context or reason why this request is being made. Will be addToQueueNotification - A call has been added to a queue and the Enqueue command’s notificationUrl is being invoked. + attr_accessor :request_type + + # Unique ID for this Call, generated by FreeClimb. + attr_accessor :call_id + + # Account ID associated with your account. attr_accessor :account_id - # ID of the conference this participant is in. - attr_accessor :conference_id + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from - # ID of the Call associated with this Participant. - attr_accessor :call_id + # Phone number provisioned to you and to which this Call is directed (in E.164 format). + attr_accessor :to + + attr_accessor :call_status - # True if this Participant has talk privileges in the Conference. False otherwise. - attr_accessor :talk + attr_accessor :direction - # True if this Participant has listen privileges in the Conference. False otherwise. - attr_accessor :listen + # Unique ID of the Conference. + attr_accessor :conference_id - # True if this Participant had dtmfPassThrough privileges in the Conference. False otherwise. - attr_accessor :dtmf_pass_through + # This is only populated if the request pertains to a Queue. Otherwise, it is set to null. + attr_accessor :queue_id + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end - # True if this Participant joining the Conference caused the Conference to start (status = inProgress). False otherwise. - attr_accessor :start_conf_on_enter + def valid?(value) + !value || allowable_values.include?(value) + end + end # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'request_type' => :'requestType', + :'call_id' => :'callId', :'account_id' => :'accountId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', :'conference_id' => :'conferenceId', - :'call_id' => :'callId', - :'talk' => :'talk', - :'listen' => :'listen', - :'dtmf_pass_through' => :'dtmfPassThrough', - :'start_conf_on_enter' => :'startConfOnEnter' + :'queue_id' => :'queueId' } end - # Returns all the JSON keys this model knows about + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) def self.acceptable_attributes - attribute_map.values + attribute_map.values.concat(superclass.acceptable_attributes) end # Attribute type mapping. def self.openapi_types { + :'request_type' => :'String', + :'call_id' => :'String', :'account_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', :'conference_id' => :'String', - :'call_id' => :'String', - :'talk' => :'Boolean', - :'listen' => :'Boolean', - :'dtmf_pass_through' => :'Boolean', - :'start_conf_on_enter' => :'Boolean' + :'queue_id' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'account_id', - :'conference_id', - :'call_id', - :'talk', - :'listen', - :'dtmf_pass_through', - :'start_conf_on_enter' + :'call_status', + :'direction', + :'queue_id' ]) end + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::ConferenceParticipantResultAllOf` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::AddToQueueNotificationWebhook` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::ConferenceParticipantResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::AddToQueueNotificationWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + if attributes.key?(:'account_id') self.account_id = attributes[:'account_id'] end - if attributes.key?(:'conference_id') - self.conference_id = attributes[:'conference_id'] + if attributes.key?(:'from') + self.from = attributes[:'from'] end - if attributes.key?(:'call_id') - self.call_id = attributes[:'call_id'] + if attributes.key?(:'to') + self.to = attributes[:'to'] end - if attributes.key?(:'talk') - self.talk = attributes[:'talk'] + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] end - if attributes.key?(:'listen') - self.listen = attributes[:'listen'] + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] end - if attributes.key?(:'dtmf_pass_through') - self.dtmf_pass_through = attributes[:'dtmf_pass_through'] + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] end - if attributes.key?(:'start_conf_on_enter') - self.start_conf_on_enter = attributes[:'start_conf_on_enter'] + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties - invalid_properties = Array.new + invalid_properties = super invalid_properties end @@ -135,7 +187,7 @@ def list_invalid_properties # @return true if the model is valid def valid? - if @account_id.nil? + if @request_type.nil? false else list_invalid_properties.length() == 0 @@ -147,13 +199,15 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && + request_type == o.request_type && + call_id == o.call_id && account_id == o.account_id && + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && conference_id == o.conference_id && - call_id == o.call_id && - talk == o.talk && - listen == o.listen && - dtmf_pass_through == o.dtmf_pass_through && - start_conf_on_enter == o.start_conf_on_enter + queue_id == o.queue_id && super(o) end # @see the `==` method @@ -165,7 +219,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [account_id, conference_id, call_id, talk, listen, dtmf_pass_through, start_conf_on_enter].hash + [request_type, call_id, account_id, from, to, call_status, direction, conference_id, queue_id].hash end # Builds the object from hash @@ -180,6 +234,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + super(attributes) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) @@ -255,7 +310,7 @@ def to_body # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash - hash = {} + hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? @@ -285,7 +340,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/answered_by.rb b/lib/freeclimb/models/answered_by.rb index 0a35354d..d835d6c8 100644 --- a/lib/freeclimb/models/answered_by.rb +++ b/lib/freeclimb/models/answered_by.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/application_list.rb b/lib/freeclimb/models/application_list.rb index 6e0fb86d..b6d5cdfe 100644 --- a/lib/freeclimb/models/application_list.rb +++ b/lib/freeclimb/models/application_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -88,7 +88,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'ApplicationListAllOf', :'PaginationModel' ] end @@ -305,7 +304,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/application_list_all_of.rb b/lib/freeclimb/models/application_list_all_of.rb deleted file mode 100644 index 73eb5c15..00000000 --- a/lib/freeclimb/models/application_list_all_of.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class ApplicationListAllOf - attr_accessor :applications - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'applications' => :'applications' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'applications' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'applications' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::ApplicationListAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::ApplicationListAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'applications') - if (value = attributes[:'applications']).is_a?(Array) - self.applications = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @applications.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - applications == o.applications - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [applications].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/application_request.rb b/lib/freeclimb/models/application_request.rb index da3f7b45..b99ee574 100644 --- a/lib/freeclimb/models/application_request.rb +++ b/lib/freeclimb/models/application_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -284,7 +284,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/application_result.rb b/lib/freeclimb/models/application_result.rb index c4a06a76..608c1211 100644 --- a/lib/freeclimb/models/application_result.rb +++ b/lib/freeclimb/models/application_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -115,7 +115,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'ApplicationResultAllOf', :'MutableResourceModel' ] end @@ -355,7 +354,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/application_result_all_of.rb b/lib/freeclimb/models/application_result_all_of.rb deleted file mode 100644 index 6edfdaa5..00000000 --- a/lib/freeclimb/models/application_result_all_of.rb +++ /dev/null @@ -1,313 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class ApplicationResultAllOf - # ID of the account that owns this phone number. - attr_accessor :account_id - - # ID of the Application that FreeClimb should contact if a Call or SMS arrives for this phone number or a Call from this number is placed. An incoming phone number is not useful until associated with an applicationId. - attr_accessor :application_id - - # Description for this phone number. Typically the conventionally-formatted version of the phone number. - attr_accessor :_alias - - # The URL FreeClimb will request when a phone number assigned to this Application receives a Call. Used for inbound calls only. - attr_accessor :voice_url - - # The URL that FreeClimb will request if it times out waiting for a response from the voiceUrl. Used for inbound calls only. - attr_accessor :voice_fallback_url - - # The URL to which FreeClimb will make a POST request informing the result of the outbound Call request. The status property of the request message specifies if the Call was connected or not. - attr_accessor :call_connect_url - - # A URL to which FreeClimb will make a POST request when the Call ends to notify this app. - attr_accessor :status_callback_url - - # The URL FreeClimb will request when a phone number assigned to this Application receives an incoming SMS message. Used for inbound SMS only. - attr_accessor :sms_url - - # The URL that FreeClimb will request if it times out waiting for a response from the smsUrl. Used for inbound SMS only. - attr_accessor :sms_fallback_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'accountId', - :'application_id' => :'applicationId', - :'_alias' => :'alias', - :'voice_url' => :'voiceUrl', - :'voice_fallback_url' => :'voiceFallbackUrl', - :'call_connect_url' => :'callConnectUrl', - :'status_callback_url' => :'statusCallbackUrl', - :'sms_url' => :'smsUrl', - :'sms_fallback_url' => :'smsFallbackUrl' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'application_id' => :'String', - :'_alias' => :'String', - :'voice_url' => :'String', - :'voice_fallback_url' => :'String', - :'call_connect_url' => :'String', - :'status_callback_url' => :'String', - :'sms_url' => :'String', - :'sms_fallback_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_id', - :'application_id', - :'_alias', - :'voice_url', - :'voice_fallback_url', - :'call_connect_url', - :'status_callback_url', - :'sms_url', - :'sms_fallback_url' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::ApplicationResultAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::ApplicationResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] - end - - if attributes.key?(:'_alias') - self._alias = attributes[:'_alias'] - end - - if attributes.key?(:'voice_url') - self.voice_url = attributes[:'voice_url'] - end - - if attributes.key?(:'voice_fallback_url') - self.voice_fallback_url = attributes[:'voice_fallback_url'] - end - - if attributes.key?(:'call_connect_url') - self.call_connect_url = attributes[:'call_connect_url'] - end - - if attributes.key?(:'status_callback_url') - self.status_callback_url = attributes[:'status_callback_url'] - end - - if attributes.key?(:'sms_url') - self.sms_url = attributes[:'sms_url'] - end - - if attributes.key?(:'sms_fallback_url') - self.sms_fallback_url = attributes[:'sms_fallback_url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @account_id.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - application_id == o.application_id && - _alias == o._alias && - voice_url == o.voice_url && - voice_fallback_url == o.voice_fallback_url && - call_connect_url == o.call_connect_url && - status_callback_url == o.status_callback_url && - sms_url == o.sms_url && - sms_fallback_url == o.sms_fallback_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, application_id, _alias, voice_url, voice_fallback_url, call_connect_url, status_callback_url, sms_url, sms_fallback_url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/available_number.rb b/lib/freeclimb/models/available_number.rb index ada71237..5ecdd92c 100644 --- a/lib/freeclimb/models/available_number.rb +++ b/lib/freeclimb/models/available_number.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -283,7 +283,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/available_number_list.rb b/lib/freeclimb/models/available_number_list.rb index ef23e043..add12a28 100644 --- a/lib/freeclimb/models/available_number_list.rb +++ b/lib/freeclimb/models/available_number_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -88,7 +88,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'AvailableNumberListAllOf', :'PaginationModel' ] end @@ -305,7 +304,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/available_number_list_all_of.rb b/lib/freeclimb/models/available_number_list_all_of.rb deleted file mode 100644 index 5f02a7b9..00000000 --- a/lib/freeclimb/models/available_number_list_all_of.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class AvailableNumberListAllOf - attr_accessor :available_phone_numbers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'available_phone_numbers' => :'availablePhoneNumbers' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'available_phone_numbers' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'available_phone_numbers' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::AvailableNumberListAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::AvailableNumberListAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'available_phone_numbers') - if (value = attributes[:'available_phone_numbers']).is_a?(Array) - self.available_phone_numbers = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @available_phone_numbers.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - available_phone_numbers == o.available_phone_numbers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [available_phone_numbers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/barge_in_reason.rb b/lib/freeclimb/models/barge_in_reason.rb new file mode 100644 index 00000000..ec412142 --- /dev/null +++ b/lib/freeclimb/models/barge_in_reason.rb @@ -0,0 +1,38 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + class BargeInReason + NO_BARGE_IN = "noBargeIn".freeze + BARGE_IN_BY_DTMF = "bargeInByDTMF".freeze + BARGE_IN_BY_ENERGY = "bargeInByEnergy".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = BargeInReason.constants.select { |c| BargeInReason::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #BargeInReason" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/models/buy_incoming_number_request.rb b/lib/freeclimb/models/buy_incoming_number_request.rb index 1a7a3f7b..c8b31bce 100644 --- a/lib/freeclimb/models/buy_incoming_number_request.rb +++ b/lib/freeclimb/models/buy_incoming_number_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -242,7 +242,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/recording_result_all_of.rb b/lib/freeclimb/models/call_control_webhook.rb similarity index 75% rename from lib/freeclimb/models/recording_result_all_of.rb rename to lib/freeclimb/models/call_control_webhook.rb index f8964bf3..98f6387c 100644 --- a/lib/freeclimb/models/recording_result_all_of.rb +++ b/lib/freeclimb/models/call_control_webhook.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -14,100 +14,113 @@ require 'time' module Freeclimb - class RecordingResultAllOf - # String that uniquely identifies this recording resource. - attr_accessor :recording_id - - # ID of the account that created this recording. - attr_accessor :account_id + # The digit sequence defined in the callControlSequence attribute of the AddToConference PerCL command has been entered by the Conference participant. A PerCL response is expected. If invalid PerCL is provided, the call leg which triggered this webhook will terminate. + class CallControlWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + CallControlWebhook.new(hash) + end + # Context or reason why this request is being made. Will be callControl. + attr_accessor :request_type - # ID of the Call that was recorded. If a Conference was recorded, this value is empty and the conferenceId property is populated. + # Unique ID for this Call, generated by FreeClimb. attr_accessor :call_id - # Length of the recording in seconds. - attr_accessor :duration_sec + # Account ID associated with your account. + attr_accessor :account_id - # ID of the Conference that was recorded. If a Call was recorded, this value is empty and the callId property is populated. + # Unique ID of the Conference. attr_accessor :conference_id + # String of digits entered by the participant. + attr_accessor :digits + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'recording_id' => :'recordingId', - :'account_id' => :'accountId', + :'request_type' => :'requestType', :'call_id' => :'callId', - :'duration_sec' => :'durationSec', - :'conference_id' => :'conferenceId' + :'account_id' => :'accountId', + :'conference_id' => :'conferenceId', + :'digits' => :'digits' } end - # Returns all the JSON keys this model knows about + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) def self.acceptable_attributes - attribute_map.values + attribute_map.values.concat(superclass.acceptable_attributes) end # Attribute type mapping. def self.openapi_types { - :'recording_id' => :'String', - :'account_id' => :'String', + :'request_type' => :'String', :'call_id' => :'String', - :'duration_sec' => :'Integer', - :'conference_id' => :'String' + :'account_id' => :'String', + :'conference_id' => :'String', + :'digits' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'recording_id', - :'account_id', - :'call_id', - :'duration_sec', - :'conference_id' ]) end + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::RecordingResultAllOf` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::CallControlWebhook` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::RecordingResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::CallControlWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'recording_id') - self.recording_id = attributes[:'recording_id'] - end + # call parent's initialize + super(attributes) - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] end if attributes.key?(:'call_id') self.call_id = attributes[:'call_id'] end - if attributes.key?(:'duration_sec') - self.duration_sec = attributes[:'duration_sec'] + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] end if attributes.key?(:'conference_id') self.conference_id = attributes[:'conference_id'] end + + if attributes.key?(:'digits') + self.digits = attributes[:'digits'] + end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties - invalid_properties = Array.new + invalid_properties = super invalid_properties end @@ -115,7 +128,7 @@ def list_invalid_properties # @return true if the model is valid def valid? - if @recording_id.nil? + if @request_type.nil? false else list_invalid_properties.length() == 0 @@ -127,11 +140,11 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - recording_id == o.recording_id && - account_id == o.account_id && + request_type == o.request_type && call_id == o.call_id && - duration_sec == o.duration_sec && - conference_id == o.conference_id + account_id == o.account_id && + conference_id == o.conference_id && + digits == o.digits && super(o) end # @see the `==` method @@ -143,7 +156,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [recording_id, account_id, call_id, duration_sec, conference_id].hash + [request_type, call_id, account_id, conference_id, digits].hash end # Builds the object from hash @@ -158,6 +171,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + super(attributes) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) @@ -233,7 +247,7 @@ def to_body # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash - hash = {} + hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? @@ -263,7 +277,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/call_direction.rb b/lib/freeclimb/models/call_direction.rb index b2783fcc..5593ec84 100644 --- a/lib/freeclimb/models/call_direction.rb +++ b/lib/freeclimb/models/call_direction.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/call_ended_reason.rb b/lib/freeclimb/models/call_ended_reason.rb new file mode 100644 index 00000000..0bb400f0 --- /dev/null +++ b/lib/freeclimb/models/call_ended_reason.rb @@ -0,0 +1,58 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + class CallEndedReason + BUSY = "busy".freeze + FAILED = "failed".freeze + NO_ANSWER = "noAnswer".freeze + CALL_CANCELED = "callCanceled".freeze + FAR_END_HANGUP = "farEndHangup".freeze + APP_HANGUP = "appHangup".freeze + APP_REJECT = "appReject".freeze + APP_NO_PERCL = "appNoPercl".freeze + APP_INVALID_PERCL = "appInvalidPercl".freeze + CONFERENCE_TERMINATED = "conferenceTerminated".freeze + CONFERENCE_EMPTIED = "conferenceEmptied".freeze + REMOVED_FROM_CONFERENCE = "removedFromConference".freeze + MACHINE_DETECTED = "machineDetected".freeze + WEBHOOK_FAILED = "webhookFailed".freeze + WEBHOOK_INVALID_RESPONSE = "webhookInvalidResponse".freeze + VOICE_DISABLED = "voiceDisabled".freeze + CONFIG_ERROR_NO_APPLICATION = "configErrorNoApplication".freeze + CONFIG_ERROR_NO_VOICE_URL = "configErrorNoVoiceUrl".freeze + MAX_REDIRECTS_ERROR = "maxRedirectsError".freeze + PERCL_PROCESSING_ERROR = "perclProcessingError".freeze + INTERNAL_ERROR = "internalError".freeze + GRPC_HANGUP = "grpcHangup".freeze + MAX_DURATION = "maxDuration".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = CallEndedReason.constants.select { |c| CallEndedReason::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #CallEndedReason" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/models/call_list.rb b/lib/freeclimb/models/call_list.rb index d75fd522..59a3b446 100644 --- a/lib/freeclimb/models/call_list.rb +++ b/lib/freeclimb/models/call_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -88,7 +88,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'CallListAllOf', :'PaginationModel' ] end @@ -305,7 +304,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/call_result.rb b/lib/freeclimb/models/call_result.rb index 7cd13757..26d24330 100644 --- a/lib/freeclimb/models/call_result.rb +++ b/lib/freeclimb/models/call_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -72,6 +72,28 @@ class CallResult # ApplicationId associated with the Call. attr_accessor :application_id + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -154,7 +176,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'CallResultAllOf', :'MutableResourceModel' ] end @@ -429,7 +450,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/call_status.rb b/lib/freeclimb/models/call_status.rb index 15116ec4..96a99333 100644 --- a/lib/freeclimb/models/call_status.rb +++ b/lib/freeclimb/models/call_status.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/call_status_webhook.rb b/lib/freeclimb/models/call_status_webhook.rb new file mode 100644 index 00000000..750fad95 --- /dev/null +++ b/lib/freeclimb/models/call_status_webhook.rb @@ -0,0 +1,354 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + # A Call has ended and the statusCallbackUrl is being invoked. This is a notification only; All PerCL commands will be ignored. + class CallStatusWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + CallStatusWebhook.new(hash) + end + # Context or reason why this request is being made. Will be callStatus - A Call has ended and the statusCallbackUrl is being invoked. + attr_accessor :request_type + + # Unique ID for this Call, generated by FreeClimb. + attr_accessor :call_id + + # Account ID associated with your account. + attr_accessor :account_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number provisioned to you and to which this Call is directed (in E.164 format). + attr_accessor :to + + attr_accessor :call_status + + attr_accessor :call_ended_reason + + attr_accessor :direction + + # Unique ID of the Conference. + attr_accessor :conference_id + + # This is only populated if the request pertains to a Queue. Otherwise, it is set to null. + attr_accessor :queue_id + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'call_id' => :'callId', + :'account_id' => :'accountId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'call_ended_reason' => :'callEndedReason', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'call_id' => :'String', + :'account_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'call_ended_reason' => :'CallEndedReason', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_status', + :'call_ended_reason', + :'direction', + :'queue_id' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::CallStatusWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::CallStatusWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] + end + + if attributes.key?(:'call_ended_reason') + self.call_ended_reason = attributes[:'call_ended_reason'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + call_id == o.call_id && + account_id == o.account_id && + from == o.from && + to == o.to && + call_status == o.call_status && + call_ended_reason == o.call_ended_reason && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, call_id, account_id, from, to, call_status, call_ended_reason, direction, conference_id, queue_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/capabilities.rb b/lib/freeclimb/models/capabilities.rb index a2b8988d..c9fcf718 100644 --- a/lib/freeclimb/models/capabilities.rb +++ b/lib/freeclimb/models/capabilities.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -264,7 +264,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/completion_request.rb b/lib/freeclimb/models/completion_request.rb index 984eaead..33ef2fa0 100644 --- a/lib/freeclimb/models/completion_request.rb +++ b/lib/freeclimb/models/completion_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -240,7 +240,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/completion_result.rb b/lib/freeclimb/models/completion_result.rb index 4926c96b..038f6c29 100644 --- a/lib/freeclimb/models/completion_result.rb +++ b/lib/freeclimb/models/completion_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -18,7 +18,6 @@ class CompletionResult # The generative response from the KnowledgeBase attr_accessor :response - # Completion result status. Possible values: success, no_context attr_accessor :status class EnumAttributeValidator @@ -60,7 +59,7 @@ def self.acceptable_attributes def self.openapi_types { :'response' => :'String', - :'status' => :'String' + :'status' => :'CompletionResultStatus' } end @@ -120,16 +119,6 @@ def valid? end end - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["success", "no_context"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -268,7 +257,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/completion_result_status.rb b/lib/freeclimb/models/completion_result_status.rb new file mode 100644 index 00000000..48152155 --- /dev/null +++ b/lib/freeclimb/models/completion_result_status.rb @@ -0,0 +1,37 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + class CompletionResultStatus + SUCCESS = "success".freeze + NO_CONTEXT = "no_context".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = CompletionResultStatus.constants.select { |c| CompletionResultStatus::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #CompletionResultStatus" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/models/conference_list.rb b/lib/freeclimb/models/conference_list.rb index 1eb1ac36..8cee2a86 100644 --- a/lib/freeclimb/models/conference_list.rb +++ b/lib/freeclimb/models/conference_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -88,7 +88,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'ConferenceListAllOf', :'PaginationModel' ] end @@ -305,7 +304,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/conference_list_all_of.rb b/lib/freeclimb/models/conference_list_all_of.rb deleted file mode 100644 index a2680ed0..00000000 --- a/lib/freeclimb/models/conference_list_all_of.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class ConferenceListAllOf - attr_accessor :conferences - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'conferences' => :'conferences' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'conferences' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'conferences' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::ConferenceListAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::ConferenceListAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'conferences') - if (value = attributes[:'conferences']).is_a?(Array) - self.conferences = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @conferences.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - conferences == o.conferences - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [conferences].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/conference_participant_list.rb b/lib/freeclimb/models/conference_participant_list.rb index a137067f..7fa23963 100644 --- a/lib/freeclimb/models/conference_participant_list.rb +++ b/lib/freeclimb/models/conference_participant_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -88,7 +88,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'ConferenceParticipantListAllOf', :'PaginationModel' ] end @@ -305,7 +304,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/conference_participant_list_all_of.rb b/lib/freeclimb/models/conference_participant_list_all_of.rb deleted file mode 100644 index 7c8812f7..00000000 --- a/lib/freeclimb/models/conference_participant_list_all_of.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class ConferenceParticipantListAllOf - attr_accessor :participants - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'participants' => :'participants' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'participants' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'participants' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::ConferenceParticipantListAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::ConferenceParticipantListAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'participants') - if (value = attributes[:'participants']).is_a?(Array) - self.participants = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @participants.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - participants == o.participants - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [participants].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/conference_participant_result.rb b/lib/freeclimb/models/conference_participant_result.rb index 3ed70d98..c69cde29 100644 --- a/lib/freeclimb/models/conference_participant_result.rb +++ b/lib/freeclimb/models/conference_participant_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -103,7 +103,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'ConferenceParticipantResultAllOf', :'MutableResourceModel' ] end @@ -333,7 +332,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/conference_recording_status_webhook.rb b/lib/freeclimb/models/conference_recording_status_webhook.rb new file mode 100644 index 00000000..ef84211e --- /dev/null +++ b/lib/freeclimb/models/conference_recording_status_webhook.rb @@ -0,0 +1,384 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + # The statusCallbackUrl request includes Recording information for a Conference that ended. This is a notification only; any PerCL returned will be ignored. + class ConferenceRecordingStatusWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + ConferenceRecordingStatusWebhook.new(hash) + end + # Context or reason why this request is being made. Will be conferenceRecordingStatus - The statusCallbackUrl request includes Recording information for a Conference that ended. + attr_accessor :request_type + + # Unique ID for this Call, generated by FreeClimb. + attr_accessor :call_id + + # Account ID associated with your account. + attr_accessor :account_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number provisioned to you and to which this Call is directed (in E.164 format). + attr_accessor :to + + attr_accessor :call_status + + attr_accessor :direction + + # Unique ID of the Conference. + attr_accessor :conference_id + + # This is only populated if the request pertains to a Queue. Otherwise, it is set to null. + attr_accessor :queue_id + + attr_accessor :status + + # URL of the Conference’s recorded audio. Populated only if a Recording exists and the Conference was emptied. + attr_accessor :recording_url + + # Unique ID of the Recording from this Conference. Populated only if a recording exists and the Conference was emptied. + attr_accessor :recording_id + + # Duration of the recorded audio (in seconds), rounded up to the nearest second. Populated only if a Recording exists and the Conference was emptied. + attr_accessor :recording_duration_sec + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'call_id' => :'callId', + :'account_id' => :'accountId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId', + :'status' => :'status', + :'recording_url' => :'recordingUrl', + :'recording_id' => :'recordingId', + :'recording_duration_sec' => :'recordingDurationSec' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'call_id' => :'String', + :'account_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String', + :'status' => :'ConferenceStatus', + :'recording_url' => :'String', + :'recording_id' => :'String', + :'recording_duration_sec' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_status', + :'direction', + :'queue_id', + :'status', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::ConferenceRecordingStatusWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::ConferenceRecordingStatusWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'recording_url') + self.recording_url = attributes[:'recording_url'] + end + + if attributes.key?(:'recording_id') + self.recording_id = attributes[:'recording_id'] + end + + if attributes.key?(:'recording_duration_sec') + self.recording_duration_sec = attributes[:'recording_duration_sec'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + call_id == o.call_id && + account_id == o.account_id && + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && + status == o.status && + recording_url == o.recording_url && + recording_id == o.recording_id && + recording_duration_sec == o.recording_duration_sec && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, call_id, account_id, from, to, call_status, direction, conference_id, queue_id, status, recording_url, recording_id, recording_duration_sec].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/conference_result.rb b/lib/freeclimb/models/conference_result.rb index 11b22ea8..12d4981a 100644 --- a/lib/freeclimb/models/conference_result.rb +++ b/lib/freeclimb/models/conference_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -55,6 +55,28 @@ class ConferenceResult # The list of subresources for this Conference. This includes participants and/or recordings. attr_accessor :subresource_uris + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -119,7 +141,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'ConferenceResultAllOf', :'MutableResourceModel' ] end @@ -169,8 +190,6 @@ def initialize(attributes = {}) if attributes.key?(:'play_beep') self.play_beep = attributes[:'play_beep'] - else - self.play_beep = 'always' end if attributes.key?(:'record') @@ -366,7 +385,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/conference_status.rb b/lib/freeclimb/models/conference_status.rb index aab2b71f..d0d9b440 100644 --- a/lib/freeclimb/models/conference_status.rb +++ b/lib/freeclimb/models/conference_status.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/conference_status_webhook.rb b/lib/freeclimb/models/conference_status_webhook.rb new file mode 100644 index 00000000..fed56134 --- /dev/null +++ b/lib/freeclimb/models/conference_status_webhook.rb @@ -0,0 +1,387 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + # The context or reason why this request is being made. Will be conferenceStatus - A Conference's status changed and its statusCallbackUrl is being invoked. + class ConferenceStatusWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + ConferenceStatusWebhook.new(hash) + end + # Context or reason why this request is being made. Will be conferenceRecordingStatus - The statusCallbackUrl request includes Recording information for a Conference that ended. + attr_accessor :request_type + + # Unique ID for this Call, generated by FreeClimb. + attr_accessor :call_id + + # Account ID associated with your account. + attr_accessor :account_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number provisioned to you and to which this Call is directed (in E.164 format). + attr_accessor :to + + attr_accessor :call_status + + attr_accessor :direction + + # Unique ID of the Conference. + attr_accessor :conference_id + + # This is only populated if the request pertains to a Queue. Otherwise, it is set to null. + attr_accessor :queue_id + + attr_accessor :status + + # The URL of the Conference’s recorded audio. Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked. + attr_accessor :recording_url + + # The unique ID of the Recording from this Conference. Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked. + attr_accessor :recording_id + + # The duration of the recorded audio rounded up to the nearest second (in seconds). Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked. + attr_accessor :recording_duration_sec + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'call_id' => :'callId', + :'account_id' => :'accountId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId', + :'status' => :'status', + :'recording_url' => :'recordingUrl', + :'recording_id' => :'recordingId', + :'recording_duration_sec' => :'recordingDurationSec' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'call_id' => :'String', + :'account_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String', + :'status' => :'ConferenceStatus', + :'recording_url' => :'String', + :'recording_id' => :'String', + :'recording_duration_sec' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_status', + :'direction', + :'queue_id', + :'status', + :'recording_url', + :'recording_id', + :'recording_duration_sec' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::ConferenceStatusWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::ConferenceStatusWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'recording_url') + self.recording_url = attributes[:'recording_url'] + end + + if attributes.key?(:'recording_id') + self.recording_id = attributes[:'recording_id'] + end + + if attributes.key?(:'recording_duration_sec') + self.recording_duration_sec = attributes[:'recording_duration_sec'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + call_id == o.call_id && + account_id == o.account_id && + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && + status == o.status && + recording_url == o.recording_url && + recording_id == o.recording_id && + recording_duration_sec == o.recording_duration_sec && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, call_id, account_id, from, to, call_status, direction, conference_id, queue_id, status, recording_url, recording_id, recording_duration_sec].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/create_conference.rb b/lib/freeclimb/models/create_conference.rb index 2db0b08c..bac08de5 100644 --- a/lib/freeclimb/models/create_conference.rb +++ b/lib/freeclimb/models/create_conference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -33,6 +33,28 @@ class CreateConference < PerclCommand # If specified, this URL provides the custom hold music for the Conference when it is in the populated state. This attribute is always fetched using HTTP GET and is fetched just once – when the Conference is created. The URL must be an audio file that is reachable and readable by FreeClimb. attr_accessor :wait_url + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -72,7 +94,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'CreateConferenceAllOf', :'PerclCommand' ] end @@ -105,8 +126,6 @@ def initialize(attributes = {}) if attributes.key?(:'play_beep') self.play_beep = attributes[:'play_beep'] - else - self.play_beep = 'always' end if attributes.key?(:'record') @@ -288,7 +307,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/create_conference_all_of.rb b/lib/freeclimb/models/create_conference_all_of.rb deleted file mode 100644 index bde8d3c0..00000000 --- a/lib/freeclimb/models/create_conference_all_of.rb +++ /dev/null @@ -1,280 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class CreateConferenceAllOf - # This URL is invoked once the Conference is successfully created. Actions on the Conference, such as adding Participants, can be performed via the PerCL script returned in the response. - attr_accessor :action_url - - # Descriptive name for the Conference. - attr_accessor :_alias - - attr_accessor :play_beep - - # When set to `true`, the entire Conference is recorded. The `statusCallbackUrl` of the Conference will receive a `conferenceRecordingEnded` Webhook when the Conference transitions from the `inProgress` to empty state. - attr_accessor :record - - # This URL is invoked when the status of the Conference changes or when a recording of the Conference has become available. - attr_accessor :status_callback_url - - # If specified, this URL provides the custom hold music for the Conference when it is in the populated state. This attribute is always fetched using HTTP GET and is fetched just once – when the Conference is created. The URL must be an audio file that is reachable and readable by FreeClimb. - attr_accessor :wait_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'action_url' => :'actionUrl', - :'_alias' => :'alias', - :'play_beep' => :'playBeep', - :'record' => :'record', - :'status_callback_url' => :'statusCallbackUrl', - :'wait_url' => :'waitUrl' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'action_url' => :'String', - :'_alias' => :'Boolean', - :'play_beep' => :'PlayBeep', - :'record' => :'Boolean', - :'status_callback_url' => :'String', - :'wait_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'play_beep', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::CreateConferenceAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::CreateConferenceAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'action_url') - self.action_url = attributes[:'action_url'] - end - - if attributes.key?(:'_alias') - self._alias = attributes[:'_alias'] - end - - if attributes.key?(:'play_beep') - self.play_beep = attributes[:'play_beep'] - else - self.play_beep = 'always' - end - - if attributes.key?(:'record') - self.record = attributes[:'record'] - end - - if attributes.key?(:'status_callback_url') - self.status_callback_url = attributes[:'status_callback_url'] - end - - if attributes.key?(:'wait_url') - self.wait_url = attributes[:'wait_url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @action_url.nil? - invalid_properties.push('invalid value for "action_url", action_url cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @action_url.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - action_url == o.action_url && - _alias == o._alias && - play_beep == o.play_beep && - record == o.record && - status_callback_url == o.status_callback_url && - wait_url == o.wait_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [action_url, _alias, play_beep, record, status_callback_url, wait_url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/create_conference_request.rb b/lib/freeclimb/models/create_conference_request.rb index 1f337685..1bde94b3 100644 --- a/lib/freeclimb/models/create_conference_request.rb +++ b/lib/freeclimb/models/create_conference_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -29,6 +29,28 @@ class CreateConferenceRequest # This URL is invoked when the status of the Conference changes. For more information, see **statusCallbackUrl** (below). attr_accessor :status_callback_url + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -84,8 +106,6 @@ def initialize(attributes = {}) if attributes.key?(:'play_beep') self.play_beep = attributes[:'play_beep'] - else - self.play_beep = 'always' end if attributes.key?(:'record') @@ -260,7 +280,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/create_conference_webhook.rb b/lib/freeclimb/models/create_conference_webhook.rb new file mode 100644 index 00000000..6644a7a1 --- /dev/null +++ b/lib/freeclimb/models/create_conference_webhook.rb @@ -0,0 +1,387 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + # A Conference has been created and its statusCallbackUrl or actionUrl is being invoked. A PerCL response is expected if the actionUrl is being invoked. + class CreateConferenceWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + CreateConferenceWebhook.new(hash) + end + # Context or reason why this request is being made. Will be createConference - A Conference has been created and its statusCallbackUrl or actionUrl is being invoked. + attr_accessor :request_type + + # Unique ID for this Call, generated by FreeClimb. + attr_accessor :call_id + + # Account ID associated with your account. + attr_accessor :account_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number provisioned to you and to which this Call is directed (in E.164 format). + attr_accessor :to + + attr_accessor :call_status + + attr_accessor :direction + + # Unique ID of the Conference. + attr_accessor :conference_id + + # This is only populated if the request pertains to a Queue. Otherwise, it is set to null. + attr_accessor :queue_id + + attr_accessor :status + + # The URL of the Conference’s recorded audio. Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked. + attr_accessor :recording_url + + # The unique ID of the Recording from this Conference. Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked. + attr_accessor :recording_id + + # The duration of the recorded audio rounded up to the nearest second (in seconds). Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked. + attr_accessor :recording_duration_sec + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'call_id' => :'callId', + :'account_id' => :'accountId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId', + :'status' => :'status', + :'recording_url' => :'recordingUrl', + :'recording_id' => :'recordingId', + :'recording_duration_sec' => :'recordingDurationSec' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'call_id' => :'String', + :'account_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String', + :'status' => :'ConferenceStatus', + :'recording_url' => :'String', + :'recording_id' => :'String', + :'recording_duration_sec' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_status', + :'direction', + :'queue_id', + :'status', + :'recording_url', + :'recording_id', + :'recording_duration_sec' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::CreateConferenceWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::CreateConferenceWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'recording_url') + self.recording_url = attributes[:'recording_url'] + end + + if attributes.key?(:'recording_id') + self.recording_id = attributes[:'recording_id'] + end + + if attributes.key?(:'recording_duration_sec') + self.recording_duration_sec = attributes[:'recording_duration_sec'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + call_id == o.call_id && + account_id == o.account_id && + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && + status == o.status && + recording_url == o.recording_url && + recording_id == o.recording_id && + recording_duration_sec == o.recording_duration_sec && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, call_id, account_id, from, to, call_status, direction, conference_id, queue_id, status, recording_url, recording_id, recording_duration_sec].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/create_web_rtc_token.rb b/lib/freeclimb/models/create_web_rtc_token.rb index 55c99924..26a67af5 100644 --- a/lib/freeclimb/models/create_web_rtc_token.rb +++ b/lib/freeclimb/models/create_web_rtc_token.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -268,7 +268,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/dequeue.rb b/lib/freeclimb/models/dequeue.rb index f1c0d5ac..48754b18 100644 --- a/lib/freeclimb/models/dequeue.rb +++ b/lib/freeclimb/models/dequeue.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -217,7 +217,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/dequeue_webhook.rb b/lib/freeclimb/models/dequeue_webhook.rb new file mode 100644 index 00000000..ee6f8b11 --- /dev/null +++ b/lib/freeclimb/models/dequeue_webhook.rb @@ -0,0 +1,365 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + # A queued call has been dequeued and the actionUrl of the corresponding Enqueue action is being invoked. A PerCL response is expected. + class DequeueWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + DequeueWebhook.new(hash) + end + # Context or reason why this request is being made. Will be dequeue - A queued call has been dequeued and the actionUrl of the corresponding Enqueue action is being invoked. + attr_accessor :request_type + + # Unique ID for this Call, generated by FreeClimb. + attr_accessor :call_id + + # Account ID associated with your account. + attr_accessor :account_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number provisioned to you and to which this Call is directed (in E.164 format). + attr_accessor :to + + attr_accessor :call_status + + attr_accessor :direction + + # Unique ID of the Conference. + attr_accessor :conference_id + + # This is only populated if the request pertains to a Queue. Otherwise, it is set to null. + attr_accessor :queue_id + + # The final result of the enqueued Call. Valid values are: •dequeued - Enqueued caller exited the Queue via a Dequeue action (Dequeue command or Queue Members POST REST API). + attr_accessor :queue_result + + # Time (in seconds) the call spent in the Queue. This is only available if the Call was actually enqueued. + attr_accessor :queue_time + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'call_id' => :'callId', + :'account_id' => :'accountId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId', + :'queue_result' => :'queueResult', + :'queue_time' => :'queueTime' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'call_id' => :'String', + :'account_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String', + :'queue_result' => :'String', + :'queue_time' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_status', + :'direction', + :'queue_id', + :'queue_time' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::DequeueWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::DequeueWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] + end + + if attributes.key?(:'queue_result') + self.queue_result = attributes[:'queue_result'] + end + + if attributes.key?(:'queue_time') + self.queue_time = attributes[:'queue_time'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + call_id == o.call_id && + account_id == o.account_id && + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && + queue_result == o.queue_result && + queue_time == o.queue_time && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, call_id, account_id, from, to, call_status, direction, conference_id, queue_id, queue_result, queue_time].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/enqueue.rb b/lib/freeclimb/models/enqueue.rb index cfce3812..03826141 100644 --- a/lib/freeclimb/models/enqueue.rb +++ b/lib/freeclimb/models/enqueue.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -62,7 +62,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'EnqueueAllOf', :'PerclCommand' ] end @@ -274,7 +273,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/enqueue_all_of.rb b/lib/freeclimb/models/enqueue_all_of.rb deleted file mode 100644 index d0ffe081..00000000 --- a/lib/freeclimb/models/enqueue_all_of.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class EnqueueAllOf - # A request is made to this URL when the Call leaves the Queue, which can occur if enqueue of the Call fails or when the call is dequeued via the `Dequeue` command, the REST API (POST to Queue Member resource), or the caller hangs up. - attr_accessor :action_url - - # URL to be invoked when the call enters the queue. The request to the URL contains the standard request parameters.This is a notification only; any PerCL returned will be ignored. - attr_accessor :notification_url - - # ID of the Queue to which to add the Call. If the Queue does not exist, it will be created. The ID must start with QU followed by 40 hex characters. - attr_accessor :queue_id - - # A request is made to this URL when the Call leaves the Queue, which can occur if enqueue of the Call fails or when the call is dequeued via the `Dequeue` command, the REST API (POST to Queue Member resource), or the caller hangs up. - attr_accessor :wait_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'action_url' => :'actionUrl', - :'notification_url' => :'notificationUrl', - :'queue_id' => :'queueId', - :'wait_url' => :'waitUrl' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'action_url' => :'String', - :'notification_url' => :'String', - :'queue_id' => :'String', - :'wait_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::EnqueueAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::EnqueueAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'action_url') - self.action_url = attributes[:'action_url'] - end - - if attributes.key?(:'notification_url') - self.notification_url = attributes[:'notification_url'] - end - - if attributes.key?(:'queue_id') - self.queue_id = attributes[:'queue_id'] - end - - if attributes.key?(:'wait_url') - self.wait_url = attributes[:'wait_url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @action_url.nil? - invalid_properties.push('invalid value for "action_url", action_url cannot be nil.') - end - - if @queue_id.nil? - invalid_properties.push('invalid value for "queue_id", queue_id cannot be nil.') - end - - if @wait_url.nil? - invalid_properties.push('invalid value for "wait_url", wait_url cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @action_url.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - action_url == o.action_url && - notification_url == o.notification_url && - queue_id == o.queue_id && - wait_url == o.wait_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [action_url, notification_url, queue_id, wait_url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/filter_logs_request.rb b/lib/freeclimb/models/filter_logs_request.rb index 79dd31aa..893583ab 100644 --- a/lib/freeclimb/models/filter_logs_request.rb +++ b/lib/freeclimb/models/filter_logs_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -222,7 +222,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/get_digits.rb b/lib/freeclimb/models/get_digits.rb index fea01dd1..8b593e62 100644 --- a/lib/freeclimb/models/get_digits.rb +++ b/lib/freeclimb/models/get_digits.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -87,7 +87,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'GetDigitsAllOf', :'PerclCommand' ] end @@ -318,7 +317,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/get_digits_all_of.rb b/lib/freeclimb/models/get_digits_all_of.rb deleted file mode 100644 index 19c8032d..00000000 --- a/lib/freeclimb/models/get_digits_all_of.rb +++ /dev/null @@ -1,310 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class GetDigitsAllOf - # When the Caller has finished entering digits, FreeClimb will make an HTTP POST request to this URL. A PerCL response is expected to continue handling the Call. Make sure to keep “http://“ in the URL. - attr_accessor :action_url - - # Maximum time in milliseconds that FreeClimb will wait for the Caller to press any digit after the last digit entered, before making a determination that a `timeout` has occurred and moving on to make the request to the actionUrl to submit the results of the `GetDigits` command. This timeout interval begins and resets after each digit entered. - attr_accessor :digit_timeout_ms - - # Digit that causes the input sequence to be deemed complete. This attribute defers to the `timeout` attribute – so, if a `timeout` occurs, then the command terminates regardless of the value of `finishOnKey`. - attr_accessor :finish_on_key - - # If set to true, the FreeClimb platform starts with an empty DTMF buffer to store the digits entered by the caller. If set to false, FreeClimb will append the user inputs to the end of the existing digits buffer and will return digits from the start of the digits buffer. - attr_accessor :flush_buffer - - # Maximum time in milliseconds that FreeClimb will wait for the Caller to press the first digit before making a determination that a `timeout` has occurred and moving on to make the request to the `actionUrl` to submit the results of the `GetDigits` command. This timeout interval begins when all nested commands have been fully executed. - attr_accessor :initial_timeout_ms - - # Maximum number of digits expected in the input. If the terminating digit is not entered and the caller has entered the maximum number of digits allowed, the `GetDigits` command terminates regardless of the value of `finishOnKey`. - attr_accessor :max_digits - - # Minimum number of digits expected in the input. If specified, FreeClimb will return the collected digits only if the Caller has entered at least that many digits. - attr_accessor :min_digits - - # JSON array of PerCL commands to nest within the `GetDigits` command. The `Say`, `Play`, and `Pause` commands can be used. The nested actions are executed while FreeClimb is waiting for input from the Caller. - attr_accessor :prompts - - # Parameter `privacyMode` will not log the `text` as required by PCI compliance. - attr_accessor :privacy_mode - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'action_url' => :'actionUrl', - :'digit_timeout_ms' => :'digitTimeoutMs', - :'finish_on_key' => :'finishOnKey', - :'flush_buffer' => :'flushBuffer', - :'initial_timeout_ms' => :'initialTimeoutMs', - :'max_digits' => :'maxDigits', - :'min_digits' => :'minDigits', - :'prompts' => :'prompts', - :'privacy_mode' => :'privacyMode' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'action_url' => :'String', - :'digit_timeout_ms' => :'Integer', - :'finish_on_key' => :'String', - :'flush_buffer' => :'Boolean', - :'initial_timeout_ms' => :'Integer', - :'max_digits' => :'Integer', - :'min_digits' => :'Integer', - :'prompts' => :'Array', - :'privacy_mode' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::GetDigitsAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::GetDigitsAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'action_url') - self.action_url = attributes[:'action_url'] - end - - if attributes.key?(:'digit_timeout_ms') - self.digit_timeout_ms = attributes[:'digit_timeout_ms'] - end - - if attributes.key?(:'finish_on_key') - self.finish_on_key = attributes[:'finish_on_key'] - end - - if attributes.key?(:'flush_buffer') - self.flush_buffer = attributes[:'flush_buffer'] - end - - if attributes.key?(:'initial_timeout_ms') - self.initial_timeout_ms = attributes[:'initial_timeout_ms'] - end - - if attributes.key?(:'max_digits') - self.max_digits = attributes[:'max_digits'] - end - - if attributes.key?(:'min_digits') - self.min_digits = attributes[:'min_digits'] - end - - if attributes.key?(:'prompts') - if (value = attributes[:'prompts']).is_a?(Array) - self.prompts = value - end - end - - if attributes.key?(:'privacy_mode') - self.privacy_mode = attributes[:'privacy_mode'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @action_url.nil? - invalid_properties.push('invalid value for "action_url", action_url cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @action_url.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - action_url == o.action_url && - digit_timeout_ms == o.digit_timeout_ms && - finish_on_key == o.finish_on_key && - flush_buffer == o.flush_buffer && - initial_timeout_ms == o.initial_timeout_ms && - max_digits == o.max_digits && - min_digits == o.min_digits && - prompts == o.prompts && - privacy_mode == o.privacy_mode - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [action_url, digit_timeout_ms, finish_on_key, flush_buffer, initial_timeout_ms, max_digits, min_digits, prompts, privacy_mode].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/get_digits_reason.rb b/lib/freeclimb/models/get_digits_reason.rb new file mode 100644 index 00000000..5725110e --- /dev/null +++ b/lib/freeclimb/models/get_digits_reason.rb @@ -0,0 +1,39 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + class GetDigitsReason + FINISH_KEY = "finishKey".freeze + TIMEOUT = "timeout".freeze + MAX_DIGITS = "maxDigits".freeze + TONE = "tone".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = GetDigitsReason.constants.select { |c| GetDigitsReason::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #GetDigitsReason" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/models/get_digits_webhook.rb b/lib/freeclimb/models/get_digits_webhook.rb new file mode 100644 index 00000000..a8bca56d --- /dev/null +++ b/lib/freeclimb/models/get_digits_webhook.rb @@ -0,0 +1,373 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + # A POST request with the following fields will be sent to the actionUrl provided in your GetDigits command. + class GetDigitsWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + GetDigitsWebhook.new(hash) + end + # Context or reason why this request is being made. Will be getDigits - The GetDigits command has completed and its actionUrl is being invoked. + attr_accessor :request_type + + # Unique ID for this Call, generated by FreeClimb. + attr_accessor :call_id + + # Account ID associated with your account. + attr_accessor :account_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number provisioned to you and to which this Call is directed (in E.164 format). + attr_accessor :to + + attr_accessor :call_status + + attr_accessor :direction + + # Unique ID of the Conference. + attr_accessor :conference_id + + # This is only populated if the request pertains to a Queue. Otherwise, it is set to null. + attr_accessor :queue_id + + # tring of digits entered by the Caller, excluding the terminating digit (if used). The string of digits will be replaced by 'xxxxx' when privacyMode is set to true + attr_accessor :digits + + attr_accessor :reason + + # ID of the Call that created this leg (child call). + attr_accessor :parent_call_id + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'call_id' => :'callId', + :'account_id' => :'accountId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId', + :'digits' => :'digits', + :'reason' => :'reason', + :'parent_call_id' => :'parentCallId' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'call_id' => :'String', + :'account_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String', + :'digits' => :'String', + :'reason' => :'GetDigitsReason', + :'parent_call_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_status', + :'direction', + :'queue_id', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::GetDigitsWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::GetDigitsWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] + end + + if attributes.key?(:'digits') + self.digits = attributes[:'digits'] + end + + if attributes.key?(:'reason') + self.reason = attributes[:'reason'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + call_id == o.call_id && + account_id == o.account_id && + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && + digits == o.digits && + reason == o.reason && + parent_call_id == o.parent_call_id && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, call_id, account_id, from, to, call_status, direction, conference_id, queue_id, digits, reason, parent_call_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/get_speech.rb b/lib/freeclimb/models/get_speech.rb index bdb41bb9..5ffc6bd0 100644 --- a/lib/freeclimb/models/get_speech.rb +++ b/lib/freeclimb/models/get_speech.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -54,6 +54,28 @@ class GetSpeech < PerclCommand # Parameter privacyMode will not log the `text` as required by PCI compliance. attr_accessor :privacy_mode + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -107,7 +129,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'GetSpeechAllOf', :'PerclCommand' ] end @@ -362,7 +383,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/get_speech_all_of.rb b/lib/freeclimb/models/get_speech_all_of.rb deleted file mode 100644 index d38390c3..00000000 --- a/lib/freeclimb/models/get_speech_all_of.rb +++ /dev/null @@ -1,354 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class GetSpeechAllOf - # When the caller has finished speaking or the command has timed out, FreeClimb will make a POST request to this URL. A PerCL response is expected to continue handling the call. - attr_accessor :action_url - - attr_accessor :grammar_type - - # The grammar file to use for speech recognition. If grammarType is set to URL, this attribute is specified as a download URL. - attr_accessor :grammar_file - - # The grammar rule within the specified grammar file to use for speech recognition. This attribute is optional if `grammarType` is `URL` and ignored if `grammarType` is `BUILTIN`. - attr_accessor :grammar_rule - - # Indicates whether a beep should be played just before speech recognition is initiated so that the speaker can start to speak. - attr_accessor :play_beep - - # The JSON array of PerCL commands to nest within the `GetSpeech` command. The `Say`, `Play`, and `Pause` commands can be used. The nested actions are executed while FreeClimb is waiting for input from the caller. This allows for playing menu options to the caller and to prompt for the expected input. These commands stop executing when the caller begins to input speech. - attr_accessor :prompts - - # When recognition is started and there is no speech detected for `noInputTimeoutMs` milliseconds, the recognizer will terminate the recognition operation. - attr_accessor :no_input_timeout_ms - - # When playback of prompts ends and there is no match for `recognitionTimeoutMs` milliseconds, the recognizer will terminate the recognition operation. - attr_accessor :recognition_timeout_ms - - # When a recognition resource recognizes a spoken phrase, it associates a confidence level with that match. Parameter `confidenceThreshold` specifies what confidence level is considered a successful match. Values are between 0.0 and 1.0. - attr_accessor :confidence_threshold - - # The speech recognizer supports a variable level of sound sensitivity. The sensitivityLevel attribute allows for filtering out background noise, so it is not mistaken for speech. Values are between 0.0 and 1.0 - attr_accessor :sensitivity_level - - # Parameter `speechCompleteTimeoutMs` specifies the length of silence required following user speech before the speech recognizer finalizes a result. This timeout applies when the recognizer currently has a complete match against an active grammar. Reasonable speech complete timeout values are typically in the range of 0.3 seconds to 1.0 seconds. - attr_accessor :speech_complete_timeout_ms - - # Parameter `speechIncompleteTimeoutMs` specifies the length of silence following user speech after which a recognizer finalizes a result. This timeout applies when the speech prior to the silence is an incomplete match of all active grammars. Timeout `speechIncompleteTimeoutMs` is usually longer than `speechCompleteTimeoutMs` to allow users to pause mid-utterance. - attr_accessor :speech_incomplete_timeout_ms - - # Parameter privacyMode will not log the `text` as required by PCI compliance. - attr_accessor :privacy_mode - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'action_url' => :'actionUrl', - :'grammar_type' => :'grammarType', - :'grammar_file' => :'grammarFile', - :'grammar_rule' => :'grammarRule', - :'play_beep' => :'playBeep', - :'prompts' => :'prompts', - :'no_input_timeout_ms' => :'noInputTimeoutMs', - :'recognition_timeout_ms' => :'recognitionTimeoutMs', - :'confidence_threshold' => :'confidenceThreshold', - :'sensitivity_level' => :'sensitivityLevel', - :'speech_complete_timeout_ms' => :'speechCompleteTimeoutMs', - :'speech_incomplete_timeout_ms' => :'speechIncompleteTimeoutMs', - :'privacy_mode' => :'privacyMode' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'action_url' => :'String', - :'grammar_type' => :'GrammarType', - :'grammar_file' => :'String', - :'grammar_rule' => :'String', - :'play_beep' => :'Boolean', - :'prompts' => :'Array', - :'no_input_timeout_ms' => :'Integer', - :'recognition_timeout_ms' => :'Integer', - :'confidence_threshold' => :'Float', - :'sensitivity_level' => :'Float', - :'speech_complete_timeout_ms' => :'Integer', - :'speech_incomplete_timeout_ms' => :'Integer', - :'privacy_mode' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'grammar_type', - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::GetSpeechAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::GetSpeechAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'action_url') - self.action_url = attributes[:'action_url'] - end - - if attributes.key?(:'grammar_type') - self.grammar_type = attributes[:'grammar_type'] - end - - if attributes.key?(:'grammar_file') - self.grammar_file = attributes[:'grammar_file'] - end - - if attributes.key?(:'grammar_rule') - self.grammar_rule = attributes[:'grammar_rule'] - end - - if attributes.key?(:'play_beep') - self.play_beep = attributes[:'play_beep'] - end - - if attributes.key?(:'prompts') - if (value = attributes[:'prompts']).is_a?(Array) - self.prompts = value - end - end - - if attributes.key?(:'no_input_timeout_ms') - self.no_input_timeout_ms = attributes[:'no_input_timeout_ms'] - end - - if attributes.key?(:'recognition_timeout_ms') - self.recognition_timeout_ms = attributes[:'recognition_timeout_ms'] - end - - if attributes.key?(:'confidence_threshold') - self.confidence_threshold = attributes[:'confidence_threshold'] - end - - if attributes.key?(:'sensitivity_level') - self.sensitivity_level = attributes[:'sensitivity_level'] - end - - if attributes.key?(:'speech_complete_timeout_ms') - self.speech_complete_timeout_ms = attributes[:'speech_complete_timeout_ms'] - end - - if attributes.key?(:'speech_incomplete_timeout_ms') - self.speech_incomplete_timeout_ms = attributes[:'speech_incomplete_timeout_ms'] - end - - if attributes.key?(:'privacy_mode') - self.privacy_mode = attributes[:'privacy_mode'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @action_url.nil? - invalid_properties.push('invalid value for "action_url", action_url cannot be nil.') - end - - if @grammar_file.nil? - invalid_properties.push('invalid value for "grammar_file", grammar_file cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @action_url.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - action_url == o.action_url && - grammar_type == o.grammar_type && - grammar_file == o.grammar_file && - grammar_rule == o.grammar_rule && - play_beep == o.play_beep && - prompts == o.prompts && - no_input_timeout_ms == o.no_input_timeout_ms && - recognition_timeout_ms == o.recognition_timeout_ms && - confidence_threshold == o.confidence_threshold && - sensitivity_level == o.sensitivity_level && - speech_complete_timeout_ms == o.speech_complete_timeout_ms && - speech_incomplete_timeout_ms == o.speech_incomplete_timeout_ms && - privacy_mode == o.privacy_mode - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [action_url, grammar_type, grammar_file, grammar_rule, play_beep, prompts, no_input_timeout_ms, recognition_timeout_ms, confidence_threshold, sensitivity_level, speech_complete_timeout_ms, speech_incomplete_timeout_ms, privacy_mode].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/get_speech_reason.rb b/lib/freeclimb/models/get_speech_reason.rb index 99354b73..b8d1f1db 100644 --- a/lib/freeclimb/models/get_speech_reason.rb +++ b/lib/freeclimb/models/get_speech_reason.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/get_speech_webhook.rb b/lib/freeclimb/models/get_speech_webhook.rb new file mode 100644 index 00000000..8f4aa9f7 --- /dev/null +++ b/lib/freeclimb/models/get_speech_webhook.rb @@ -0,0 +1,423 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + # The GetSpeech command has completed and its actionUrl is being invoked. A PerCL response is expected, unless reason is hangup. + class GetSpeechWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + GetSpeechWebhook.new(hash) + end + # Context or reason why this request is being made. Will be getSpeech - The GetSpeech command has completed and its actionUrl is being invoked. + attr_accessor :request_type + + # Unique ID for this Call, generated by FreeClimb. + attr_accessor :call_id + + # Account ID associated with your account. + attr_accessor :account_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number provisioned to you and to which this Call is directed (in E.164 format). + attr_accessor :to + + attr_accessor :call_status + + attr_accessor :direction + + # Unique ID of the Conference. + attr_accessor :conference_id + + # This is only populated if the request pertains to a Queue. Otherwise, it is set to null. + attr_accessor :queue_id + + attr_accessor :reason + + # Semantic content (either a string if speech was recognized or a digit if a digit was input instead of speech) returned from the entry or tag that was recognized within the grammar. The content will be replaced by 'xxxxx' when privacyMode is set to true. This field is populated only if the reason field is set to recognition or digit. + attr_accessor :recognition_result + + # Level of confidence in the obtained result. This is a value in the range 0 to 100 – with 0 being total lack of confidence and 100 being absolute certainty in the recognition. This field is populated only if the reason field is set to recognition. + attr_accessor :confidence + + # ID of the Call that created this leg (child call). + attr_accessor :parent_call_id + + # Advanced diagnostic information if reason was error. See RFC 6787 section 9.4.12 - speech recognition. + attr_accessor :completion_reason + + # Advanced diagnostic information if reason was error. See RFC 6787 section 9.4.11 - speech recognition. + attr_accessor :completion_cause + + # Advanced diagnostic information if reason was error. See RFC 6787 section 5.4 - MRCPv2 specification. + attr_accessor :mrcp_code + + # Advanced diagnostic information if reason was error. See RFC 6787 section 5.4 - MRCPv2 specification. + attr_accessor :mrcp_diagnostic + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'call_id' => :'callId', + :'account_id' => :'accountId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId', + :'reason' => :'reason', + :'recognition_result' => :'recognitionResult', + :'confidence' => :'confidence', + :'parent_call_id' => :'parentCallId', + :'completion_reason' => :'completionReason', + :'completion_cause' => :'completionCause', + :'mrcp_code' => :'mrcpCode', + :'mrcp_diagnostic' => :'mrcpDiagnostic' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'call_id' => :'String', + :'account_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String', + :'reason' => :'GetSpeechReason', + :'recognition_result' => :'String', + :'confidence' => :'Integer', + :'parent_call_id' => :'String', + :'completion_reason' => :'String', + :'completion_cause' => :'String', + :'mrcp_code' => :'Integer', + :'mrcp_diagnostic' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_status', + :'direction', + :'queue_id', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::GetSpeechWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::GetSpeechWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] + end + + if attributes.key?(:'reason') + self.reason = attributes[:'reason'] + end + + if attributes.key?(:'recognition_result') + self.recognition_result = attributes[:'recognition_result'] + end + + if attributes.key?(:'confidence') + self.confidence = attributes[:'confidence'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + + if attributes.key?(:'completion_reason') + self.completion_reason = attributes[:'completion_reason'] + end + + if attributes.key?(:'completion_cause') + self.completion_cause = attributes[:'completion_cause'] + end + + if attributes.key?(:'mrcp_code') + self.mrcp_code = attributes[:'mrcp_code'] + end + + if attributes.key?(:'mrcp_diagnostic') + self.mrcp_diagnostic = attributes[:'mrcp_diagnostic'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + call_id == o.call_id && + account_id == o.account_id && + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && + reason == o.reason && + recognition_result == o.recognition_result && + confidence == o.confidence && + parent_call_id == o.parent_call_id && + completion_reason == o.completion_reason && + completion_cause == o.completion_cause && + mrcp_code == o.mrcp_code && + mrcp_diagnostic == o.mrcp_diagnostic && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, call_id, account_id, from, to, call_status, direction, conference_id, queue_id, reason, recognition_result, confidence, parent_call_id, completion_reason, completion_cause, mrcp_code, mrcp_diagnostic].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/grammar_file_built_in.rb b/lib/freeclimb/models/grammar_file_built_in.rb index cff68a06..22745d84 100644 --- a/lib/freeclimb/models/grammar_file_built_in.rb +++ b/lib/freeclimb/models/grammar_file_built_in.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/grammar_type.rb b/lib/freeclimb/models/grammar_type.rb index d7efe96b..c6f8dfa2 100644 --- a/lib/freeclimb/models/grammar_type.rb +++ b/lib/freeclimb/models/grammar_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/hangup.rb b/lib/freeclimb/models/hangup.rb index fd97add0..fa1f783a 100644 --- a/lib/freeclimb/models/hangup.rb +++ b/lib/freeclimb/models/hangup.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -47,7 +47,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'HangupAllOf', :'PerclCommand' ] end @@ -232,7 +231,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/hangup_all_of.rb b/lib/freeclimb/models/hangup_all_of.rb deleted file mode 100644 index 6c4ffeb0..00000000 --- a/lib/freeclimb/models/hangup_all_of.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class HangupAllOf - # The user defined reason for the hangup. In general, applications should use a set of enumerated values that are predefined to cover all exit points of the Call flows for the given application. - attr_accessor :reason - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reason' => :'reason' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'reason' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::HangupAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::HangupAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reason') - self.reason = attributes[:'reason'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @reason.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reason == o.reason - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reason].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/if_machine.rb b/lib/freeclimb/models/if_machine.rb index 599adfdc..b8e566fa 100644 --- a/lib/freeclimb/models/if_machine.rb +++ b/lib/freeclimb/models/if_machine.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/inbound_call_webhook.rb b/lib/freeclimb/models/inbound_call_webhook.rb new file mode 100644 index 00000000..9823ab19 --- /dev/null +++ b/lib/freeclimb/models/inbound_call_webhook.rb @@ -0,0 +1,355 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + # An inbound Call to a number registered on FreeClimb will trigger a request to the voiceUrl of the application the number is assigned to. FreeClimb expects to receive PerCL in response to this request in order to process the Call. The following parameters are sent as the POST body. + class InboundCallWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + InboundCallWebhook.new(hash) + end + # Context or reason why this request is being made. Will be inboundCall - An inbound call was received and the voiceUrl is being invoked. + attr_accessor :request_type + + # Unique ID for this Call, generated by FreeClimb. + attr_accessor :call_id + + # Account ID associated with your account. + attr_accessor :account_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number provisioned to you and to which this Call is directed (in E.164 format). + attr_accessor :to + + attr_accessor :call_status + + attr_accessor :direction + + # This is only populated if request pertains to a Conference. Otherwise, it is set to null. + attr_accessor :conference_id + + # This is only populated if the request pertains to a Queue. Otherwise, it is set to null. + attr_accessor :queue_id + + attr_accessor :parent_call_id + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'call_id' => :'callId', + :'account_id' => :'accountId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId', + :'parent_call_id' => :'parentCallId' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'call_id' => :'String', + :'account_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String', + :'parent_call_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_status', + :'direction', + :'conference_id', + :'queue_id', + :'parent_call_id' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::InboundCallWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::InboundCallWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + call_id == o.call_id && + account_id == o.account_id && + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && + parent_call_id == o.parent_call_id && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, call_id, account_id, from, to, call_status, direction, conference_id, queue_id, parent_call_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/incoming_number_list.rb b/lib/freeclimb/models/incoming_number_list.rb index 6a2ca6dc..f645fa3d 100644 --- a/lib/freeclimb/models/incoming_number_list.rb +++ b/lib/freeclimb/models/incoming_number_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -88,7 +88,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'IncomingNumberListAllOf', :'PaginationModel' ] end @@ -305,7 +304,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/incoming_number_list_all_of.rb b/lib/freeclimb/models/incoming_number_list_all_of.rb deleted file mode 100644 index d1917d39..00000000 --- a/lib/freeclimb/models/incoming_number_list_all_of.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class IncomingNumberListAllOf - attr_accessor :incoming_phone_numbers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'incoming_phone_numbers' => :'incomingPhoneNumbers' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'incoming_phone_numbers' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'incoming_phone_numbers' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::IncomingNumberListAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::IncomingNumberListAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'incoming_phone_numbers') - if (value = attributes[:'incoming_phone_numbers']).is_a?(Array) - self.incoming_phone_numbers = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @incoming_phone_numbers.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - incoming_phone_numbers == o.incoming_phone_numbers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [incoming_phone_numbers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/incoming_number_request.rb b/lib/freeclimb/models/incoming_number_request.rb index 28699846..bc4cf0c5 100644 --- a/lib/freeclimb/models/incoming_number_request.rb +++ b/lib/freeclimb/models/incoming_number_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -239,7 +239,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/incoming_number_result.rb b/lib/freeclimb/models/incoming_number_result.rb index 230f5afd..9203855c 100644 --- a/lib/freeclimb/models/incoming_number_result.rb +++ b/lib/freeclimb/models/incoming_number_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -135,7 +135,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'IncomingNumberResultAllOf', :'MutableResourceModel' ] end @@ -395,7 +394,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/language.rb b/lib/freeclimb/models/language.rb index 6d8af8ef..def8fd47 100644 --- a/lib/freeclimb/models/language.rb +++ b/lib/freeclimb/models/language.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/conference_result_all_of.rb b/lib/freeclimb/models/leave_conference_webhook.rb similarity index 63% rename from lib/freeclimb/models/conference_result_all_of.rb rename to lib/freeclimb/models/leave_conference_webhook.rb index f2521746..2805127c 100644 --- a/lib/freeclimb/models/conference_result_all_of.rb +++ b/lib/freeclimb/models/leave_conference_webhook.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -14,150 +14,173 @@ require 'time' module Freeclimb - class ConferenceResultAllOf - # A string that uniquely identifies this Conference resource. - attr_accessor :conference_id + # A Call has been unbridged from a Conference and its leaveConferenceUrl is being invoked. A PerCL response is expected — unless the URL is invoked due to the participant hanging up. + class LeaveConferenceWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + LeaveConferenceWebhook.new(hash) + end + # Context or reason why this request is being made. Will be leaveConference - Call has been unbridged from a Conference and its leaveConferenceUrl is being invoked. + attr_accessor :request_type - # ID of the account that created this Conference. - attr_accessor :account_id + # Unique ID for this Call, generated by FreeClimb. This is the call leg which has left the Conference + attr_accessor :call_id - # A description for this Conference. - attr_accessor :_alias + # Account ID associated with your account. + attr_accessor :account_id - attr_accessor :play_beep + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from - # Flag indicating whether recording is enabled for this Conference. - attr_accessor :record + # Phone number provisioned to you and to which this Call is directed (in E.164 format). + attr_accessor :to - attr_accessor :status + attr_accessor :call_status - # URL referencing the audio file to be used as default wait music for the Conference when it is in the populated state. - attr_accessor :wait_url + attr_accessor :direction - # URL invoked once the Conference is successfully created. - attr_accessor :action_url + # This is only populated if request pertains to a Conference. Otherwise, it is set to null. + attr_accessor :conference_id - # URL to inform that the Conference status has changed. - attr_accessor :status_callback_url + # This is only populated if the request pertains to a Queue. Otherwise, it is set to null. + attr_accessor :queue_id + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end - # The list of subresources for this Conference. This includes participants and/or recordings. - attr_accessor :subresource_uris + def valid?(value) + !value || allowable_values.include?(value) + end + end # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'conference_id' => :'conferenceId', + :'request_type' => :'requestType', + :'call_id' => :'callId', :'account_id' => :'accountId', - :'_alias' => :'alias', - :'play_beep' => :'playBeep', - :'record' => :'record', - :'status' => :'status', - :'wait_url' => :'waitUrl', - :'action_url' => :'actionUrl', - :'status_callback_url' => :'statusCallbackUrl', - :'subresource_uris' => :'subresourceUris' + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId' } end - # Returns all the JSON keys this model knows about + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) def self.acceptable_attributes - attribute_map.values + attribute_map.values.concat(superclass.acceptable_attributes) end # Attribute type mapping. def self.openapi_types { - :'conference_id' => :'String', + :'request_type' => :'String', + :'call_id' => :'String', :'account_id' => :'String', - :'_alias' => :'String', - :'play_beep' => :'PlayBeep', - :'record' => :'Boolean', - :'status' => :'ConferenceStatus', - :'wait_url' => :'String', - :'action_url' => :'String', - :'status_callback_url' => :'String', - :'subresource_uris' => :'Object' + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :'call_status', + :'direction', :'conference_id', - :'account_id', - :'_alias', - :'play_beep', - :'record', - :'status', - :'wait_url', - :'action_url', - :'status_callback_url', - :'subresource_uris' + :'queue_id' ]) end + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::ConferenceResultAllOf` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::LeaveConferenceWebhook` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::ConferenceResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::LeaveConferenceWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'conference_id') - self.conference_id = attributes[:'conference_id'] - end + # call parent's initialize + super(attributes) - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] end - if attributes.key?(:'_alias') - self._alias = attributes[:'_alias'] + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] end - if attributes.key?(:'play_beep') - self.play_beep = attributes[:'play_beep'] - else - self.play_beep = 'always' + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] end - if attributes.key?(:'record') - self.record = attributes[:'record'] + if attributes.key?(:'from') + self.from = attributes[:'from'] end - if attributes.key?(:'status') - self.status = attributes[:'status'] + if attributes.key?(:'to') + self.to = attributes[:'to'] end - if attributes.key?(:'wait_url') - self.wait_url = attributes[:'wait_url'] + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] end - if attributes.key?(:'action_url') - self.action_url = attributes[:'action_url'] + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] end - if attributes.key?(:'status_callback_url') - self.status_callback_url = attributes[:'status_callback_url'] + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] end - if attributes.key?(:'subresource_uris') - self.subresource_uris = attributes[:'subresource_uris'] + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties - invalid_properties = Array.new + invalid_properties = super invalid_properties end @@ -165,7 +188,7 @@ def list_invalid_properties # @return true if the model is valid def valid? - if @conference_id.nil? + if @request_type.nil? false else list_invalid_properties.length() == 0 @@ -177,16 +200,15 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - conference_id == o.conference_id && + request_type == o.request_type && + call_id == o.call_id && account_id == o.account_id && - _alias == o._alias && - play_beep == o.play_beep && - record == o.record && - status == o.status && - wait_url == o.wait_url && - action_url == o.action_url && - status_callback_url == o.status_callback_url && - subresource_uris == o.subresource_uris + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && super(o) end # @see the `==` method @@ -198,7 +220,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [conference_id, account_id, _alias, play_beep, record, status, wait_url, action_url, status_callback_url, subresource_uris].hash + [request_type, call_id, account_id, from, to, call_status, direction, conference_id, queue_id].hash end # Builds the object from hash @@ -213,6 +235,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + super(attributes) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) @@ -288,7 +311,7 @@ def to_body # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash - hash = {} + hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? @@ -318,7 +341,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/log_level.rb b/lib/freeclimb/models/log_level.rb index 3972b4aa..a4a58d0d 100644 --- a/lib/freeclimb/models/log_level.rb +++ b/lib/freeclimb/models/log_level.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/log_list.rb b/lib/freeclimb/models/log_list.rb index a4a762cf..c2024dcb 100644 --- a/lib/freeclimb/models/log_list.rb +++ b/lib/freeclimb/models/log_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -88,7 +88,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'LogListAllOf', :'PaginationModel' ] end @@ -305,7 +304,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/log_list_all_of.rb b/lib/freeclimb/models/log_list_all_of.rb deleted file mode 100644 index 488b3134..00000000 --- a/lib/freeclimb/models/log_list_all_of.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class LogListAllOf - attr_accessor :logs - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'logs' => :'logs' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'logs' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'logs' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::LogListAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::LogListAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'logs') - if (value = attributes[:'logs']).is_a?(Array) - self.logs = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @logs.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - logs == o.logs - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [logs].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/log_result.rb b/lib/freeclimb/models/log_result.rb index b2c2106c..b6f20a38 100644 --- a/lib/freeclimb/models/log_result.rb +++ b/lib/freeclimb/models/log_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -35,6 +35,28 @@ class LogResult # JSON document containing metadata about the event. Some log messages may include request and response header content in this field. attr_accessor :metadata + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -284,7 +306,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/call_result_all_of.rb b/lib/freeclimb/models/machine_detected_webhook.rb similarity index 63% rename from lib/freeclimb/models/call_result_all_of.rb rename to lib/freeclimb/models/machine_detected_webhook.rb index df4a5ed8..5f45cb0d 100644 --- a/lib/freeclimb/models/call_result_all_of.rb +++ b/lib/freeclimb/models/machine_detected_webhook.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -14,144 +14,147 @@ require 'time' module Freeclimb - class CallResultAllOf - # String that uniquely identifies this Call resource. - attr_accessor :call_id + # An outbound call spawned by OutDial detected an answer by a machine (answering machine or fax/modem machine) and ifMachineUrl is being invoked. A PerCL response is expected. + class MachineDetectedWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + MachineDetectedWebhook.new(hash) + end + # Context or reason why this request is being made. Will be machineDetected - An outbound call spawned by OutDial was answered by a machine and the ifMachineUrl is being invoked. + attr_accessor :request_type - # ID of the Call that created this leg (child Call). - attr_accessor :parent_call_id + # Unique ID for this Call, generated by FreeClimb. + attr_accessor :call_id - # ID of the account that owns this Call. + # Account ID associated with your account. attr_accessor :account_id - # Phone number that initiated this Call. + # Phone number of the party that initiated the Call (in E.164 format). attr_accessor :from - # Phone number that received this Call. + # Phone number provisioned to you and to which this Call is directed (in E.164 format). attr_accessor :to - # If the Call was inbound, this is the ID of the IncomingPhoneNumber that received the Call (DNIS). If the Call was outbound, this is the ID of the phone number from which the Call was placed (ANI). - attr_accessor :phone_number_id - attr_accessor :call_status - # Start time of the Call (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call has not yet been dialed. - attr_accessor :start_time - - # Time the Call was answered (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call has not yet been dialed. - attr_accessor :connect_time - - # End time of the Call (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call did not complete successfully. - attr_accessor :end_time - - # Total length of the Call in seconds. Measures time between startTime and endTime. This value is empty for busy, failed, unanswered or ongoing Calls. - attr_accessor :duration + attr_accessor :direction - # Length of time that the Call was connected in seconds. Measures time between connectTime and endTime. This value is empty for busy, failed, unanswered or ongoing Calls. - attr_accessor :connect_duration + # This is only populated if request pertains to a Conference. Otherwise, it is set to null. + attr_accessor :conference_id - attr_accessor :direction + # This is only populated if the request pertains to a Queue. Otherwise, it is set to null. + attr_accessor :queue_id - attr_accessor :answered_by + # Call ID of the leg which initiated the OutDial. + attr_accessor :parent_call_id - # The list of subresources for this Call. These include things like logs and recordings associated with the Call. - attr_accessor :subresource_uris + attr_accessor :machine_type + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end - # ApplicationId associated with the Call. - attr_accessor :application_id + def valid?(value) + !value || allowable_values.include?(value) + end + end # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'request_type' => :'requestType', :'call_id' => :'callId', - :'parent_call_id' => :'parentCallId', :'account_id' => :'accountId', :'from' => :'from', :'to' => :'to', - :'phone_number_id' => :'phoneNumberId', :'call_status' => :'callStatus', - :'start_time' => :'startTime', - :'connect_time' => :'connectTime', - :'end_time' => :'endTime', - :'duration' => :'duration', - :'connect_duration' => :'connectDuration', :'direction' => :'direction', - :'answered_by' => :'answeredBy', - :'subresource_uris' => :'subresourceUris', - :'application_id' => :'applicationId' + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId', + :'parent_call_id' => :'parentCallId', + :'machine_type' => :'machineType' } end - # Returns all the JSON keys this model knows about + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) def self.acceptable_attributes - attribute_map.values + attribute_map.values.concat(superclass.acceptable_attributes) end # Attribute type mapping. def self.openapi_types { + :'request_type' => :'String', :'call_id' => :'String', - :'parent_call_id' => :'String', :'account_id' => :'String', :'from' => :'String', :'to' => :'String', - :'phone_number_id' => :'String', :'call_status' => :'CallStatus', - :'start_time' => :'String', - :'connect_time' => :'String', - :'end_time' => :'String', - :'duration' => :'Integer', - :'connect_duration' => :'Integer', :'direction' => :'CallDirection', - :'answered_by' => :'AnsweredBy', - :'subresource_uris' => :'Object', - :'application_id' => :'String' + :'conference_id' => :'String', + :'queue_id' => :'String', + :'parent_call_id' => :'String', + :'machine_type' => :'MachineType' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'call_id', - :'parent_call_id', - :'account_id', - :'from', - :'to', - :'phone_number_id', :'call_status', - :'start_time', - :'connect_time', - :'end_time', - :'duration', - :'connect_duration', :'direction', - :'answered_by', - :'subresource_uris', - :'application_id' + :'conference_id', + :'queue_id', ]) end + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::CallResultAllOf` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::MachineDetectedWebhook` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::CallResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::MachineDetectedWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'call_id') - self.call_id = attributes[:'call_id'] + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] end - if attributes.key?(:'parent_call_id') - self.parent_call_id = attributes[:'parent_call_id'] + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] end if attributes.key?(:'account_id') @@ -166,55 +169,35 @@ def initialize(attributes = {}) self.to = attributes[:'to'] end - if attributes.key?(:'phone_number_id') - self.phone_number_id = attributes[:'phone_number_id'] - end - if attributes.key?(:'call_status') self.call_status = attributes[:'call_status'] end - if attributes.key?(:'start_time') - self.start_time = attributes[:'start_time'] - end - - if attributes.key?(:'connect_time') - self.connect_time = attributes[:'connect_time'] - end - - if attributes.key?(:'end_time') - self.end_time = attributes[:'end_time'] - end - - if attributes.key?(:'duration') - self.duration = attributes[:'duration'] - end - - if attributes.key?(:'connect_duration') - self.connect_duration = attributes[:'connect_duration'] - end - if attributes.key?(:'direction') self.direction = attributes[:'direction'] end - if attributes.key?(:'answered_by') - self.answered_by = attributes[:'answered_by'] + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] end - if attributes.key?(:'subresource_uris') - self.subresource_uris = attributes[:'subresource_uris'] + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] end - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] + if attributes.key?(:'machine_type') + self.machine_type = attributes[:'machine_type'] end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties - invalid_properties = Array.new + invalid_properties = super invalid_properties end @@ -222,7 +205,7 @@ def list_invalid_properties # @return true if the model is valid def valid? - if @call_id.nil? + if @request_type.nil? false else list_invalid_properties.length() == 0 @@ -234,22 +217,17 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && + request_type == o.request_type && call_id == o.call_id && - parent_call_id == o.parent_call_id && account_id == o.account_id && from == o.from && to == o.to && - phone_number_id == o.phone_number_id && call_status == o.call_status && - start_time == o.start_time && - connect_time == o.connect_time && - end_time == o.end_time && - duration == o.duration && - connect_duration == o.connect_duration && direction == o.direction && - answered_by == o.answered_by && - subresource_uris == o.subresource_uris && - application_id == o.application_id + conference_id == o.conference_id && + queue_id == o.queue_id && + parent_call_id == o.parent_call_id && + machine_type == o.machine_type && super(o) end # @see the `==` method @@ -261,7 +239,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [call_id, parent_call_id, account_id, from, to, phone_number_id, call_status, start_time, connect_time, end_time, duration, connect_duration, direction, answered_by, subresource_uris, application_id].hash + [request_type, call_id, account_id, from, to, call_status, direction, conference_id, queue_id, parent_call_id, machine_type].hash end # Builds the object from hash @@ -276,6 +254,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + super(attributes) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) @@ -351,7 +330,7 @@ def to_body # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash - hash = {} + hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? @@ -381,7 +360,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/machine_type.rb b/lib/freeclimb/models/machine_type.rb index 92a7bcda..bf26e6a5 100644 --- a/lib/freeclimb/models/machine_type.rb +++ b/lib/freeclimb/models/machine_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -15,8 +15,8 @@ module Freeclimb class MachineType - ANSWERING_MACHINE = "answeringMachine".freeze - FAX_MACHINE = "faxMachine".freeze + ANSWERING_MACHINE = "answering machine".freeze + FAX_MODEM = "fax modem".freeze # Builds the enum from string # @param [String] The enum value in the form of the string diff --git a/lib/freeclimb/models/make_call_request.rb b/lib/freeclimb/models/make_call_request.rb index f018e3db..c611e81d 100644 --- a/lib/freeclimb/models/make_call_request.rb +++ b/lib/freeclimb/models/make_call_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -318,7 +318,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/message_result_all_of.rb b/lib/freeclimb/models/message_delivery_webhook.rb similarity index 70% rename from lib/freeclimb/models/message_result_all_of.rb rename to lib/freeclimb/models/message_delivery_webhook.rb index 2a73b47a..8784730c 100644 --- a/lib/freeclimb/models/message_result_all_of.rb +++ b/lib/freeclimb/models/message_delivery_webhook.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -14,126 +14,119 @@ require 'time' module Freeclimb - class MessageResultAllOf - # String that uniquely identifies this account resource. - attr_accessor :account_id - - # String that uniquely identifies this message resource - attr_accessor :message_id + # An SMS has been received by the platform and is being delivered to the smsUrl of the customer application that is associated with the destination number. A PerCL response will be ignored. + class MessageDeliveryWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + MessageDeliveryWebhook.new(hash) + end + # Value will be messageDelivery - An SMS message has been received by the platform and is being delivered to the customer application associated with the destination number. + attr_accessor :request_type - attr_accessor :status + # Account ID associated with your account. + attr_accessor :account_id - # Phone number in E.164 format that sent the message. + # Phone number of the party that initiated the Call (in E.164 format). attr_accessor :from - # Phone number in E.164 format that received the message. + # Phone number provisioned to you and to which this Call is directed (in E.164 format). attr_accessor :to - # Message contents + # Body of the SMS message. attr_accessor :text - # Noting whether the message was inbound or outbound + # Value will be inbound to indicate the receipt of a message into the FreeClimb platform. attr_accessor :direction - # URL invoked when message sent - attr_accessor :notification_url - - # The unique identifier for the brand associated with the message - attr_accessor :brand_id + # ID of the application to which the destination number is assigned. + attr_accessor :application_id - # The unique identifier for the campaign associated with the message - attr_accessor :campaign_id + # Value will be received to indicate that the platform has successfully received the incoming message. + attr_accessor :status - # The number of segments into which the message was split - attr_accessor :segment_count + # ID of the destination phone number. + attr_accessor :phone_number_id - # an array of HTTP URLs which were attached this this message - attr_accessor :media_urls + # The URI for this resource, relative to the API base URL + attr_accessor :uri # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'request_type' => :'requestType', :'account_id' => :'accountId', - :'message_id' => :'messageId', - :'status' => :'status', :'from' => :'from', :'to' => :'to', :'text' => :'text', :'direction' => :'direction', - :'notification_url' => :'notificationUrl', - :'brand_id' => :'brandId', - :'campaign_id' => :'campaignId', - :'segment_count' => :'segmentCount', - :'media_urls' => :'mediaUrls' + :'application_id' => :'applicationId', + :'status' => :'status', + :'phone_number_id' => :'phoneNumberId', + :'uri' => :'uri' } end - # Returns all the JSON keys this model knows about + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) def self.acceptable_attributes - attribute_map.values + attribute_map.values.concat(superclass.acceptable_attributes) end # Attribute type mapping. def self.openapi_types { + :'request_type' => :'String', :'account_id' => :'String', - :'message_id' => :'String', - :'status' => :'MessageStatus', :'from' => :'String', :'to' => :'String', :'text' => :'String', :'direction' => :'String', - :'notification_url' => :'String', - :'brand_id' => :'String', - :'campaign_id' => :'String', - :'segment_count' => :'Float', - :'media_urls' => :'Array' + :'application_id' => :'String', + :'status' => :'String', + :'phone_number_id' => :'String', + :'uri' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'account_id', - :'message_id', - :'status', - :'from', - :'to', - :'text', - :'direction', - :'notification_url', - :'brand_id', - :'campaign_id', - :'segment_count', - :'media_urls' ]) end + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::MessageResultAllOf` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::MessageDeliveryWebhook` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::MessageResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::MessageDeliveryWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end + # call parent's initialize + super(attributes) - if attributes.key?(:'message_id') - self.message_id = attributes[:'message_id'] + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] end - if attributes.key?(:'status') - self.status = attributes[:'status'] + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] end if attributes.key?(:'from') @@ -152,33 +145,27 @@ def initialize(attributes = {}) self.direction = attributes[:'direction'] end - if attributes.key?(:'notification_url') - self.notification_url = attributes[:'notification_url'] + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] end - if attributes.key?(:'brand_id') - self.brand_id = attributes[:'brand_id'] - end - - if attributes.key?(:'campaign_id') - self.campaign_id = attributes[:'campaign_id'] + if attributes.key?(:'status') + self.status = attributes[:'status'] end - if attributes.key?(:'segment_count') - self.segment_count = attributes[:'segment_count'] + if attributes.key?(:'phone_number_id') + self.phone_number_id = attributes[:'phone_number_id'] end - if attributes.key?(:'media_urls') - if (value = attributes[:'media_urls']).is_a?(Array) - self.media_urls = value - end + if attributes.key?(:'uri') + self.uri = attributes[:'uri'] end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties - invalid_properties = Array.new + invalid_properties = super invalid_properties end @@ -186,7 +173,7 @@ def list_invalid_properties # @return true if the model is valid def valid? - if @account_id.nil? + if @request_type.nil? false else list_invalid_properties.length() == 0 @@ -198,18 +185,16 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && + request_type == o.request_type && account_id == o.account_id && - message_id == o.message_id && - status == o.status && from == o.from && to == o.to && text == o.text && direction == o.direction && - notification_url == o.notification_url && - brand_id == o.brand_id && - campaign_id == o.campaign_id && - segment_count == o.segment_count && - media_urls == o.media_urls + application_id == o.application_id && + status == o.status && + phone_number_id == o.phone_number_id && + uri == o.uri && super(o) end # @see the `==` method @@ -221,7 +206,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [account_id, message_id, status, from, to, text, direction, notification_url, brand_id, campaign_id, segment_count, media_urls].hash + [request_type, account_id, from, to, text, direction, application_id, status, phone_number_id, uri].hash end # Builds the object from hash @@ -236,6 +221,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + super(attributes) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) @@ -311,7 +297,7 @@ def to_body # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash - hash = {} + hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? @@ -341,7 +327,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/message_direction.rb b/lib/freeclimb/models/message_direction.rb index 2adbd1f3..d12daa57 100644 --- a/lib/freeclimb/models/message_direction.rb +++ b/lib/freeclimb/models/message_direction.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/message_request.rb b/lib/freeclimb/models/message_request.rb index 6d3f8f48..df815d10 100644 --- a/lib/freeclimb/models/message_request.rb +++ b/lib/freeclimb/models/message_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -87,7 +87,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'MessageRequestAllOf', :'MutableResourceModel' ] end @@ -321,7 +320,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/message_request_all_of.rb b/lib/freeclimb/models/message_request_all_of.rb deleted file mode 100644 index d2db181a..00000000 --- a/lib/freeclimb/models/message_request_all_of.rb +++ /dev/null @@ -1,279 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class MessageRequestAllOf - # Phone number to use as the sender. This must be an incoming phone number that you have purchased from FreeClimb. - attr_accessor :from - - # Phone number to receive the message. Must be within FreeClimb's service area. - attr_accessor :to - - # Text contained in the message (maximum 160 characters). **Note:** For text, only ASCII characters are supported. - attr_accessor :text - - # When the Message changes status, this URL is invoked using HTTP POST with the messageStatus parameters. **Note:** This is a notification only; any PerCL returned is ignored. - attr_accessor :notification_url - - # an array of HTTP URLs which are to be used as attachments to the message. This will force the message into being an MMS message and must be done using a from number which is MMS capabile. - attr_accessor :media_urls - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'from' => :'from', - :'to' => :'to', - :'text' => :'text', - :'notification_url' => :'notificationUrl', - :'media_urls' => :'mediaUrls' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'from' => :'String', - :'to' => :'String', - :'text' => :'String', - :'notification_url' => :'String', - :'media_urls' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'media_urls' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::MessageRequestAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::MessageRequestAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'from') - self.from = attributes[:'from'] - end - - if attributes.key?(:'to') - self.to = attributes[:'to'] - end - - if attributes.key?(:'text') - self.text = attributes[:'text'] - end - - if attributes.key?(:'notification_url') - self.notification_url = attributes[:'notification_url'] - end - - if attributes.key?(:'media_urls') - if (value = attributes[:'media_urls']).is_a?(Array) - self.media_urls = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @from.nil? - invalid_properties.push('invalid value for "from", from cannot be nil.') - end - - if @to.nil? - invalid_properties.push('invalid value for "to", to cannot be nil.') - end - - if @text.nil? - invalid_properties.push('invalid value for "text", text cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @from.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - from == o.from && - to == o.to && - text == o.text && - notification_url == o.notification_url && - media_urls == o.media_urls - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [from, to, text, notification_url, media_urls].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/message_result.rb b/lib/freeclimb/models/message_result.rb index 062e2780..07d0a8b7 100644 --- a/lib/freeclimb/models/message_result.rb +++ b/lib/freeclimb/models/message_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -62,6 +62,28 @@ class MessageResult # an array of HTTP URLs which were attached this this message attr_accessor :media_urls + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -132,7 +154,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'MessageResultAllOf', :'MutableResourceModel' ] end @@ -389,7 +410,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/message_status.rb b/lib/freeclimb/models/message_status.rb index 9129de6f..f389c9f8 100644 --- a/lib/freeclimb/models/message_status.rb +++ b/lib/freeclimb/models/message_status.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/incoming_number_result_all_of.rb b/lib/freeclimb/models/message_status_webhook.rb similarity index 62% rename from lib/freeclimb/models/incoming_number_result_all_of.rb rename to lib/freeclimb/models/message_status_webhook.rb index 936bae71..461e757a 100644 --- a/lib/freeclimb/models/incoming_number_result_all_of.rb +++ b/lib/freeclimb/models/message_status_webhook.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -14,176 +14,189 @@ require 'time' module Freeclimb - class IncomingNumberResultAllOf - attr_accessor :capabilities + # An outbound SMS has changed status and the notificationUrl from the Sms command or Send an SMS request is being invoked. A PerCL response will be ignored. + class MessageStatusWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + MessageStatusWebhook.new(hash) + end + # Value will be messageStatus - An outbound SMS has changed status and the Sms command's notificationUrl is being invoked. + attr_accessor :request_type - # The campaign ID generated by the campaign registry - attr_accessor :campaign_id + # Account ID associated with your account. + attr_accessor :account_id - # String that uniquely identifies this phone number resource. - attr_accessor :phone_number_id + # Unique ID for this message, generated by FreeClimb. + attr_accessor :message_id - # ID of the account that owns this phone number. - attr_accessor :account_id + # Unique ID for the Call in the context of which the Sms PerCL command was issued. + attr_accessor :call_id - # ID of the Application that FreeClimb should contact if a Call or SMS arrives for this phone number or a Call from this number is placed. An incoming phone number is not useful until associated with an applicationId. - attr_accessor :application_id + # aPhone number used to initiate the SMS message (in E.164 format). + attr_accessor :from - # Phone number in E.164 format. - attr_accessor :phone_number + # Destination number of the SMS message (in E.164 format). + attr_accessor :to - # Description for this phone number. Typically the conventionally-formatted version of the phone number. - attr_accessor :_alias + # Body of the SMS message. + attr_accessor :text - # State or province of this phone number. - attr_accessor :region + # Value will be outbound to indicate an outgoing SMS from FreeClimb. + attr_accessor :direction - # Country of this phone number. - attr_accessor :country + # ID of the application to which the destination number is assigned. May be null if the originating number is invalid in some way or is not registered to an application. + attr_accessor :application_id - # Indicates whether the phone number can handle Calls. Typically set to true for all numbers. - attr_accessor :voice_enabled + attr_accessor :status - # Indication of whether the phone number can handle sending and receiving SMS messages. Typically set to true for all numbers. - attr_accessor :sms_enabled + # ID of the destination phone number. + attr_accessor :phone_number_id - # The offnet field is a boolean representing whether the number is offnet registered or not. This field will be rendered only for requests to the IncomingPhone number resource. - attr_accessor :offnet + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end - attr_accessor :tfn + def valid?(value) + !value || allowable_values.include?(value) + end + end # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'capabilities' => :'capabilities', - :'campaign_id' => :'campaignId', - :'phone_number_id' => :'phoneNumberId', + :'request_type' => :'requestType', :'account_id' => :'accountId', + :'message_id' => :'messageId', + :'call_id' => :'callId', + :'from' => :'from', + :'to' => :'to', + :'text' => :'text', + :'direction' => :'direction', :'application_id' => :'applicationId', - :'phone_number' => :'phoneNumber', - :'_alias' => :'alias', - :'region' => :'region', - :'country' => :'country', - :'voice_enabled' => :'voiceEnabled', - :'sms_enabled' => :'smsEnabled', - :'offnet' => :'offnet', - :'tfn' => :'tfn' + :'status' => :'status', + :'phone_number_id' => :'phoneNumberId' } end - # Returns all the JSON keys this model knows about + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) def self.acceptable_attributes - attribute_map.values + attribute_map.values.concat(superclass.acceptable_attributes) end # Attribute type mapping. def self.openapi_types { - :'capabilities' => :'Capabilities', - :'campaign_id' => :'String', - :'phone_number_id' => :'String', + :'request_type' => :'String', :'account_id' => :'String', + :'message_id' => :'String', + :'call_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'text' => :'String', + :'direction' => :'String', :'application_id' => :'String', - :'phone_number' => :'String', - :'_alias' => :'String', - :'region' => :'String', - :'country' => :'String', - :'voice_enabled' => :'Boolean', - :'sms_enabled' => :'Boolean', - :'offnet' => :'Boolean', - :'tfn' => :'TFN' + :'status' => :'MessageStatus', + :'phone_number_id' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'campaign_id', - :'phone_number_id', - :'account_id', - :'application_id', - :'phone_number', - :'_alias', - :'region', - :'country', - :'voice_enabled', - :'sms_enabled', - :'offnet', + :'status', ]) end + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::IncomingNumberResultAllOf` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::MessageStatusWebhook` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::IncomingNumberResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::MessageStatusWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'capabilities') - self.capabilities = attributes[:'capabilities'] - end + # call parent's initialize + super(attributes) - if attributes.key?(:'campaign_id') - self.campaign_id = attributes[:'campaign_id'] - end - - if attributes.key?(:'phone_number_id') - self.phone_number_id = attributes[:'phone_number_id'] + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] end if attributes.key?(:'account_id') self.account_id = attributes[:'account_id'] end - if attributes.key?(:'application_id') - self.application_id = attributes[:'application_id'] + if attributes.key?(:'message_id') + self.message_id = attributes[:'message_id'] end - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] end - if attributes.key?(:'_alias') - self._alias = attributes[:'_alias'] + if attributes.key?(:'from') + self.from = attributes[:'from'] end - if attributes.key?(:'region') - self.region = attributes[:'region'] + if attributes.key?(:'to') + self.to = attributes[:'to'] end - if attributes.key?(:'country') - self.country = attributes[:'country'] + if attributes.key?(:'text') + self.text = attributes[:'text'] end - if attributes.key?(:'voice_enabled') - self.voice_enabled = attributes[:'voice_enabled'] + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] end - if attributes.key?(:'sms_enabled') - self.sms_enabled = attributes[:'sms_enabled'] + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] end - if attributes.key?(:'offnet') - self.offnet = attributes[:'offnet'] + if attributes.key?(:'status') + self.status = attributes[:'status'] end - if attributes.key?(:'tfn') - self.tfn = attributes[:'tfn'] + if attributes.key?(:'phone_number_id') + self.phone_number_id = attributes[:'phone_number_id'] end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties - invalid_properties = Array.new + invalid_properties = super invalid_properties end @@ -191,7 +204,7 @@ def list_invalid_properties # @return true if the model is valid def valid? - if @capabilities.nil? + if @request_type.nil? false else list_invalid_properties.length() == 0 @@ -203,19 +216,17 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - capabilities == o.capabilities && - campaign_id == o.campaign_id && - phone_number_id == o.phone_number_id && + request_type == o.request_type && account_id == o.account_id && + message_id == o.message_id && + call_id == o.call_id && + from == o.from && + to == o.to && + text == o.text && + direction == o.direction && application_id == o.application_id && - phone_number == o.phone_number && - _alias == o._alias && - region == o.region && - country == o.country && - voice_enabled == o.voice_enabled && - sms_enabled == o.sms_enabled && - offnet == o.offnet && - tfn == o.tfn + status == o.status && + phone_number_id == o.phone_number_id && super(o) end # @see the `==` method @@ -227,7 +238,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [capabilities, campaign_id, phone_number_id, account_id, application_id, phone_number, _alias, region, country, voice_enabled, sms_enabled, offnet, tfn].hash + [request_type, account_id, message_id, call_id, from, to, text, direction, application_id, status, phone_number_id].hash end # Builds the object from hash @@ -242,6 +253,7 @@ def self.build_from_hash(attributes) # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) + super(attributes) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) @@ -317,7 +329,7 @@ def to_body # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash - hash = {} + hash = super self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? @@ -347,7 +359,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/messages_list.rb b/lib/freeclimb/models/messages_list.rb index d842ce47..67402a21 100644 --- a/lib/freeclimb/models/messages_list.rb +++ b/lib/freeclimb/models/messages_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -89,7 +89,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'MessagesListAllOf', :'PaginationModel' ] end @@ -306,7 +305,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/messages_list_all_of.rb b/lib/freeclimb/models/messages_list_all_of.rb deleted file mode 100644 index 8ebeb875..00000000 --- a/lib/freeclimb/models/messages_list_all_of.rb +++ /dev/null @@ -1,227 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class MessagesListAllOf - # Array of messages - attr_accessor :messages - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'messages' => :'messages' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'messages' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'messages' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::MessagesListAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::MessagesListAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'messages') - if (value = attributes[:'messages']).is_a?(Array) - self.messages = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @messages.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - messages == o.messages - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [messages].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/mutable_resource_model.rb b/lib/freeclimb/models/mutable_resource_model.rb index 356cfa1a..d6bde92f 100644 --- a/lib/freeclimb/models/mutable_resource_model.rb +++ b/lib/freeclimb/models/mutable_resource_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -248,7 +248,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/out_dial.rb b/lib/freeclimb/models/out_dial.rb index 59d4cd0b..dc99e2c3 100644 --- a/lib/freeclimb/models/out_dial.rb +++ b/lib/freeclimb/models/out_dial.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -45,6 +45,28 @@ class OutDial < PerclCommand # Parameter `privacyMode` will not log the `text` as required by PCI compliance. attr_accessor :privacy_mode + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -91,7 +113,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'OutDialAllOf', :'PerclCommand' ] end @@ -337,7 +358,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/out_dial_all_of.rb b/lib/freeclimb/models/out_dial_all_of.rb deleted file mode 100644 index ab2fae7c..00000000 --- a/lib/freeclimb/models/out_dial_all_of.rb +++ /dev/null @@ -1,329 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class OutDialAllOf - # URL to which FreeClimb sends an HTTP POST request. - attr_accessor :action_url - - # URL to which FreeClimb makes an HTTP POST request informing the result of the OutDial. - attr_accessor :call_connect_url - - # he caller ID to show to the called party when FreeClimb calls. This can be one of the following: The To or From number provided in the first Webhook to your webserver. Any phone number you have purchased from FreeClimb. - attr_accessor :calling_number - - # E.164 representation of the phone number to Call. - attr_accessor :destination - - attr_accessor :if_machine - - # When the `ifMachine` flag is set to `redirect`, this attribute specifies a URL to which FreeClimb makes a POST request when an answering machine or a fax machine is detected. This URL is required if the `ifMachine` flag is set to `redirect`. Otherwise, it should not be included. - attr_accessor :if_machine_url - - # DTMF tones to play to the outdialed Call. This is typically used to dial a number and then dial an extension. - attr_accessor :send_digits - - # When the outdialed Call leg terminates, FreeClimb sends a `callStatus` Webhook to the `statusCallbackUrl`. This is a notification only; any PerCL command returned is ignored. - attr_accessor :status_callback_url - - # Maximum time in seconds the `OutDial` command waits for the called party to answer the Call. When a timeout occurs, FreeClimb invokes the `callConnectUrl` Webhook to report that the out-dialed Call has ended with a status of `noAnswer`. - attr_accessor :timeout - - # Parameter `privacyMode` will not log the `text` as required by PCI compliance. - attr_accessor :privacy_mode - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'action_url' => :'actionUrl', - :'call_connect_url' => :'callConnectUrl', - :'calling_number' => :'callingNumber', - :'destination' => :'destination', - :'if_machine' => :'ifMachine', - :'if_machine_url' => :'ifMachineUrl', - :'send_digits' => :'sendDigits', - :'status_callback_url' => :'statusCallbackUrl', - :'timeout' => :'timeout', - :'privacy_mode' => :'privacyMode' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'action_url' => :'String', - :'call_connect_url' => :'String', - :'calling_number' => :'String', - :'destination' => :'String', - :'if_machine' => :'IfMachine', - :'if_machine_url' => :'String', - :'send_digits' => :'String', - :'status_callback_url' => :'String', - :'timeout' => :'Integer', - :'privacy_mode' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::OutDialAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::OutDialAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'action_url') - self.action_url = attributes[:'action_url'] - end - - if attributes.key?(:'call_connect_url') - self.call_connect_url = attributes[:'call_connect_url'] - end - - if attributes.key?(:'calling_number') - self.calling_number = attributes[:'calling_number'] - end - - if attributes.key?(:'destination') - self.destination = attributes[:'destination'] - end - - if attributes.key?(:'if_machine') - self.if_machine = attributes[:'if_machine'] - end - - if attributes.key?(:'if_machine_url') - self.if_machine_url = attributes[:'if_machine_url'] - end - - if attributes.key?(:'send_digits') - self.send_digits = attributes[:'send_digits'] - end - - if attributes.key?(:'status_callback_url') - self.status_callback_url = attributes[:'status_callback_url'] - end - - if attributes.key?(:'timeout') - self.timeout = attributes[:'timeout'] - end - - if attributes.key?(:'privacy_mode') - self.privacy_mode = attributes[:'privacy_mode'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @action_url.nil? - invalid_properties.push('invalid value for "action_url", action_url cannot be nil.') - end - - if @call_connect_url.nil? - invalid_properties.push('invalid value for "call_connect_url", call_connect_url cannot be nil.') - end - - if @calling_number.nil? - invalid_properties.push('invalid value for "calling_number", calling_number cannot be nil.') - end - - if @destination.nil? - invalid_properties.push('invalid value for "destination", destination cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @action_url.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - action_url == o.action_url && - call_connect_url == o.call_connect_url && - calling_number == o.calling_number && - destination == o.destination && - if_machine == o.if_machine && - if_machine_url == o.if_machine_url && - send_digits == o.send_digits && - status_callback_url == o.status_callback_url && - timeout == o.timeout && - privacy_mode == o.privacy_mode - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [action_url, call_connect_url, calling_number, destination, if_machine, if_machine_url, send_digits, status_callback_url, timeout, privacy_mode].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/out_dial_api_connect_webhook.rb b/lib/freeclimb/models/out_dial_api_connect_webhook.rb new file mode 100644 index 00000000..c09c25ac --- /dev/null +++ b/lib/freeclimb/models/out_dial_api_connect_webhook.rb @@ -0,0 +1,355 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + # An outbound call initiated by the REST API has connected and the callConnectUrl specified in the API request is being invoked. A PerCL response is expected if the call was successfully connected (with status of inProgress). + class OutDialApiConnectWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + OutDialApiConnectWebhook.new(hash) + end + # Context or reason why this request is being made. Will be outDialApiConnect - An outbound call spawned by the REST API has connected and the callConnectUrl specified in the API request is being invoked. + attr_accessor :request_type + + # Account ID associated with your account. + attr_accessor :account_id + + # Unique identifier for this Call, generated by FreeClimb + attr_accessor :call_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number or SIP URL of the party that is receiving the call (phone number in E.164 format). + attr_accessor :to + + attr_accessor :call_status + + attr_accessor :direction + + # This is only populated if request pertains to a conference. Otherwise, it is set to null. + attr_accessor :conference_id + + # This is only populated if the request pertains to a queue. Otherwise, it is set to null. + attr_accessor :queue_id + + # ID of the Call that created this leg (child call). + attr_accessor :parent_call_id + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'account_id' => :'accountId', + :'call_id' => :'callId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId', + :'parent_call_id' => :'parentCallId' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'account_id' => :'String', + :'call_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String', + :'parent_call_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_status', + :'direction', + :'conference_id', + :'queue_id', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::OutDialApiConnectWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::OutDialApiConnectWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + account_id == o.account_id && + call_id == o.call_id && + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && + parent_call_id == o.parent_call_id && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, account_id, call_id, from, to, call_status, direction, conference_id, queue_id, parent_call_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/out_dial_connect_webhook.rb b/lib/freeclimb/models/out_dial_connect_webhook.rb new file mode 100644 index 00000000..36e94e48 --- /dev/null +++ b/lib/freeclimb/models/out_dial_connect_webhook.rb @@ -0,0 +1,355 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + # A Call generated by OutDial has connected and the callConnectUrl is being invoked. This request is made in the context of the Call leg that was generated using OutDial and not the parent (the OutDialStart webhook is invoked on the parent call to continue that call context). A PerCL response is expected if the call was successfully connected (as indicated by status of inProgress) and begins the execution context for this (child) call. + class OutDialConnectWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + OutDialConnectWebhook.new(hash) + end + # Context or reason why this request is being made. Will be outDialConnect - A Call generated by OutDial has connected and the callConnectUrl is being invoked. + attr_accessor :request_type + + # Account ID associated with your account. + attr_accessor :account_id + + # Unique identifier for this Call, generated by FreeClimb + attr_accessor :call_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number or SIP URL of the party that is receiving the call (phone number in E.164 format). + attr_accessor :to + + attr_accessor :call_status + + attr_accessor :direction + + # This is only populated if request pertains to a conference. Otherwise, it is set to null. + attr_accessor :conference_id + + # This is only populated if the request pertains to a queue. Otherwise, it is set to null. + attr_accessor :queue_id + + # ID of the Call that created this leg (child call). + attr_accessor :parent_call_id + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'account_id' => :'accountId', + :'call_id' => :'callId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId', + :'parent_call_id' => :'parentCallId' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'account_id' => :'String', + :'call_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String', + :'parent_call_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_status', + :'direction', + :'conference_id', + :'queue_id', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::OutDialConnectWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::OutDialConnectWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + account_id == o.account_id && + call_id == o.call_id && + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && + parent_call_id == o.parent_call_id && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, account_id, call_id, from, to, call_status, direction, conference_id, queue_id, parent_call_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/out_dial_start_webhook.rb b/lib/freeclimb/models/out_dial_start_webhook.rb new file mode 100644 index 00000000..b935a03d --- /dev/null +++ b/lib/freeclimb/models/out_dial_start_webhook.rb @@ -0,0 +1,366 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + # The OutDial command has started and the actionUrl is being invoked. This request is made in the context of the parent call (Call leg that invoked). A PerCL response is expected. + class OutDialStartWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + OutDialStartWebhook.new(hash) + end + # Context or reason why this request is being made. Will be outDialStart - The OutDial command has started and the actionUrl is being invoked. + attr_accessor :request_type + + # Account ID associated with your account. + attr_accessor :account_id + + # Unique identifier for this Call, generated by FreeClimb + attr_accessor :call_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number provisioned to the customer and to which this Call is directed (in E.164 format). + attr_accessor :to + + attr_accessor :call_status + + attr_accessor :direction + + # This is only populated if request pertains to a conference. Otherwise, it is set to null. + attr_accessor :conference_id + + # This is only populated if the request pertains to a queue. Otherwise, it is set to null. + attr_accessor :queue_id + + # ID of the child call that was generated as a result of the Outdial. + attr_accessor :dial_call_id + + # ID of the Call that created this leg (child call). If this was an inbound call or call created via REST API with no parent, this field will be null. + attr_accessor :parent_call_id + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'account_id' => :'accountId', + :'call_id' => :'callId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId', + :'dial_call_id' => :'dialCallId', + :'parent_call_id' => :'parentCallId' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'account_id' => :'String', + :'call_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String', + :'dial_call_id' => :'String', + :'parent_call_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_status', + :'direction', + :'conference_id', + :'queue_id', + :'parent_call_id' + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::OutDialStartWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::OutDialStartWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] + end + + if attributes.key?(:'dial_call_id') + self.dial_call_id = attributes[:'dial_call_id'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + account_id == o.account_id && + call_id == o.call_id && + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && + dial_call_id == o.dial_call_id && + parent_call_id == o.parent_call_id && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, account_id, call_id, from, to, call_status, direction, conference_id, queue_id, dial_call_id, parent_call_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/pagination_model.rb b/lib/freeclimb/models/pagination_model.rb index 846c132d..49e86a84 100644 --- a/lib/freeclimb/models/pagination_model.rb +++ b/lib/freeclimb/models/pagination_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -285,7 +285,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/park.rb b/lib/freeclimb/models/park.rb index 43b310bb..8120fcd0 100644 --- a/lib/freeclimb/models/park.rb +++ b/lib/freeclimb/models/park.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -57,7 +57,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'ParkAllOf', :'PerclCommand' ] end @@ -260,7 +259,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/park_all_of.rb b/lib/freeclimb/models/park_all_of.rb deleted file mode 100644 index 4e9afe2f..00000000 --- a/lib/freeclimb/models/park_all_of.rb +++ /dev/null @@ -1,252 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class ParkAllOf - # Specifies a URL pointing to a PerCL script containing actions to be executed while the caller is Parked. Once the script returned by the waitUrl runs out of commands to execute, FreeClimb will re-request the waitUrl and start over, essentially looping the script requests indefinitely. - attr_accessor :wait_url - - # A request is made to this URL when the Call is resumed, which can occur if the Call is resumed via the Unpark command, the REST API (POST to Call resource), or the caller hangs up. The PerCL script returned in response to the actionUrl will be executed on the resumed call. - attr_accessor :action_url - - # URL to be invoked when the Call is parked. The request to the URL contains the standard request parameters. - attr_accessor :notification_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'wait_url' => :'waitUrl', - :'action_url' => :'actionUrl', - :'notification_url' => :'notificationUrl' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'wait_url' => :'String', - :'action_url' => :'String', - :'notification_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::ParkAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::ParkAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'wait_url') - self.wait_url = attributes[:'wait_url'] - end - - if attributes.key?(:'action_url') - self.action_url = attributes[:'action_url'] - end - - if attributes.key?(:'notification_url') - self.notification_url = attributes[:'notification_url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @wait_url.nil? - invalid_properties.push('invalid value for "wait_url", wait_url cannot be nil.') - end - - if @action_url.nil? - invalid_properties.push('invalid value for "action_url", action_url cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @wait_url.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - wait_url == o.wait_url && - action_url == o.action_url && - notification_url == o.notification_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [wait_url, action_url, notification_url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/pause.rb b/lib/freeclimb/models/pause.rb index fd09d944..21ea880a 100644 --- a/lib/freeclimb/models/pause.rb +++ b/lib/freeclimb/models/pause.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -47,7 +47,6 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PauseAllOf', :'PerclCommand' ] end @@ -236,7 +235,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/pause_all_of.rb b/lib/freeclimb/models/pause_all_of.rb deleted file mode 100644 index a840e8b3..00000000 --- a/lib/freeclimb/models/pause_all_of.rb +++ /dev/null @@ -1,228 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class PauseAllOf - # Length in milliseconds. FreeClimb will wait silently before continuing on. - attr_accessor :length - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'length' => :'length' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'length' => :'Integer' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::PauseAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::PauseAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'length') - self.length = attributes[:'length'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @length.nil? - invalid_properties.push('invalid value for "length", length cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @length.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - length == o.length - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [length].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/percl_command.rb b/lib/freeclimb/models/percl_command.rb index da72d63e..b8770da3 100644 --- a/lib/freeclimb/models/percl_command.rb +++ b/lib/freeclimb/models/percl_command.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -224,7 +224,7 @@ def _to_hash(value) value end end - def to_percl_hash() + def to_percl_hash command = self.command attributes = self.class.attribute_map percl_hash = attributes.each_with_object({}) do |(attr, percl_attr), hash| @@ -239,9 +239,7 @@ def to_percl_hash() end result = {} result[command] = percl_hash - return result + result end - end - end diff --git a/lib/freeclimb/models/percl_script.rb b/lib/freeclimb/models/percl_script.rb index 3d72ca35..b2dd1a2c 100644 --- a/lib/freeclimb/models/percl_script.rb +++ b/lib/freeclimb/models/percl_script.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -221,11 +221,9 @@ def _to_hash(value) value end end - def to_json() + def to_json commands = self.commands.map { |command| command.to_percl_hash } commands.to_json end - end - end diff --git a/lib/freeclimb/models/play.rb b/lib/freeclimb/models/play.rb index e7eee9a2..99e27576 100644 --- a/lib/freeclimb/models/play.rb +++ b/lib/freeclimb/models/play.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -57,8 +57,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PerclCommand', - :'PlayAllOf' + :'PerclCommand' ] end @@ -256,7 +255,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/play_all_of.rb b/lib/freeclimb/models/play_all_of.rb deleted file mode 100644 index 0465adc4..00000000 --- a/lib/freeclimb/models/play_all_of.rb +++ /dev/null @@ -1,248 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class PlayAllOf - # RL of the audio file to be played to the caller. The URL can be the `recordingUrl` generated from the `RecordUtterance` or `StartRecordCall` PerCL commands. - attr_accessor :file - - # Number of times the audio file is played. Specifying '0' causes the Play action to loop until the Call is hung up. - attr_accessor :loop - - # Parameter `privacyMode` will not log the `text` as required by PCI compliance. - attr_accessor :privacy_mode - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'file' => :'file', - :'loop' => :'loop', - :'privacy_mode' => :'privacyMode' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'file' => :'String', - :'loop' => :'Integer', - :'privacy_mode' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::PlayAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::PlayAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'file') - self.file = attributes[:'file'] - end - - if attributes.key?(:'loop') - self.loop = attributes[:'loop'] - end - - if attributes.key?(:'privacy_mode') - self.privacy_mode = attributes[:'privacy_mode'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @file.nil? - invalid_properties.push('invalid value for "file", file cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @file.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - file == o.file && - loop == o.loop && - privacy_mode == o.privacy_mode - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [file, loop, privacy_mode].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/play_beep.rb b/lib/freeclimb/models/play_beep.rb index 475ec533..5c85c7ba 100644 --- a/lib/freeclimb/models/play_beep.rb +++ b/lib/freeclimb/models/play_beep.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/play_early_media.rb b/lib/freeclimb/models/play_early_media.rb index f49f1854..cce0fa8b 100644 --- a/lib/freeclimb/models/play_early_media.rb +++ b/lib/freeclimb/models/play_early_media.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -47,8 +47,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PerclCommand', - :'PlayEarlyMediaAllOf' + :'PerclCommand' ] end @@ -236,7 +235,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/play_early_media_all_of.rb b/lib/freeclimb/models/play_early_media_all_of.rb deleted file mode 100644 index 1ccb5981..00000000 --- a/lib/freeclimb/models/play_early_media_all_of.rb +++ /dev/null @@ -1,228 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class PlayEarlyMediaAllOf - # RL of the audio file to be played to the caller. The URL can be the `recordingUrl` generated from the `RecordUtterance` or `StartRecordCall` PerCL commands or any accessible URL. FreeClimb will respect Cache-Control headers for this file. Use these to limit repeated requests for unchanged audio. If no Cache-Control header is provided, the file will be cached for seven days by default. - attr_accessor :file - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'file' => :'file' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'file' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::PlayEarlyMediaAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::PlayEarlyMediaAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'file') - self.file = attributes[:'file'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @file.nil? - invalid_properties.push('invalid value for "file", file cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @file.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - file == o.file - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [file].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/queue_list.rb b/lib/freeclimb/models/queue_list.rb index 864af1e4..69487b8d 100644 --- a/lib/freeclimb/models/queue_list.rb +++ b/lib/freeclimb/models/queue_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -88,8 +88,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PaginationModel', - :'QueueListAllOf' + :'PaginationModel' ] end @@ -305,7 +304,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/queue_list_all_of.rb b/lib/freeclimb/models/queue_list_all_of.rb deleted file mode 100644 index d901fd8c..00000000 --- a/lib/freeclimb/models/queue_list_all_of.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class QueueListAllOf - attr_accessor :queues - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'queues' => :'queues' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'queues' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'queues' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::QueueListAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::QueueListAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'queues') - if (value = attributes[:'queues']).is_a?(Array) - self.queues = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @queues.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - queues == o.queues - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [queues].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/queue_member.rb b/lib/freeclimb/models/queue_member.rb index f6c8319e..74d35ee2 100644 --- a/lib/freeclimb/models/queue_member.rb +++ b/lib/freeclimb/models/queue_member.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -263,7 +263,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/queue_member_list.rb b/lib/freeclimb/models/queue_member_list.rb index 13dd8320..9c3d7648 100644 --- a/lib/freeclimb/models/queue_member_list.rb +++ b/lib/freeclimb/models/queue_member_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -88,8 +88,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PaginationModel', - :'QueueMemberListAllOf' + :'PaginationModel' ] end @@ -305,7 +304,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/queue_member_list_all_of.rb b/lib/freeclimb/models/queue_member_list_all_of.rb deleted file mode 100644 index c3d7c319..00000000 --- a/lib/freeclimb/models/queue_member_list_all_of.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class QueueMemberListAllOf - attr_accessor :queue_members - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'queue_members' => :'queueMembers' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'queue_members' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'queue_members' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::QueueMemberListAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::QueueMemberListAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'queue_members') - if (value = attributes[:'queue_members']).is_a?(Array) - self.queue_members = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @queue_members.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - queue_members == o.queue_members - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [queue_members].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/queue_request.rb b/lib/freeclimb/models/queue_request.rb index 60b4e3bc..02c3ed5d 100644 --- a/lib/freeclimb/models/queue_request.rb +++ b/lib/freeclimb/models/queue_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -230,7 +230,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/queue_result.rb b/lib/freeclimb/models/queue_result.rb index eb5e0428..9f88d627 100644 --- a/lib/freeclimb/models/queue_result.rb +++ b/lib/freeclimb/models/queue_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -103,8 +103,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'MutableResourceModel', - :'QueueResultAllOf' + :'MutableResourceModel' ] end @@ -333,7 +332,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/queue_result_all_of.rb b/lib/freeclimb/models/queue_result_all_of.rb deleted file mode 100644 index 78f80be5..00000000 --- a/lib/freeclimb/models/queue_result_all_of.rb +++ /dev/null @@ -1,291 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class QueueResultAllOf - # ID of the account that created this Queue. - attr_accessor :account_id - - # A string that uniquely identifies this Queue resource. - attr_accessor :queue_id - - # A description for this Queue. - attr_accessor :_alias - - # The maximum number of Calls permitted in the Queue. Default is 100. Maximum is 1000. - attr_accessor :max_size - - # Count of Calls currently in the Queue. - attr_accessor :current_size - - # The average amount of time (in seconds) for a call to be removed from the queue. - attr_accessor :average_queue_removal_time - - # List of subresources for this Queue (which includes Queue members). - attr_accessor :subresource_uris - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account_id' => :'accountId', - :'queue_id' => :'queueId', - :'_alias' => :'alias', - :'max_size' => :'maxSize', - :'current_size' => :'currentSize', - :'average_queue_removal_time' => :'averageQueueRemovalTime', - :'subresource_uris' => :'subresourceUris' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'account_id' => :'String', - :'queue_id' => :'String', - :'_alias' => :'String', - :'max_size' => :'Integer', - :'current_size' => :'Integer', - :'average_queue_removal_time' => :'Integer', - :'subresource_uris' => :'Object' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'account_id', - :'queue_id', - :'_alias', - :'max_size', - :'current_size', - :'average_queue_removal_time', - :'subresource_uris' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::QueueResultAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::QueueResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'queue_id') - self.queue_id = attributes[:'queue_id'] - end - - if attributes.key?(:'_alias') - self._alias = attributes[:'_alias'] - end - - if attributes.key?(:'max_size') - self.max_size = attributes[:'max_size'] - end - - if attributes.key?(:'current_size') - self.current_size = attributes[:'current_size'] - end - - if attributes.key?(:'average_queue_removal_time') - self.average_queue_removal_time = attributes[:'average_queue_removal_time'] - end - - if attributes.key?(:'subresource_uris') - self.subresource_uris = attributes[:'subresource_uris'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @account_id.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account_id == o.account_id && - queue_id == o.queue_id && - _alias == o._alias && - max_size == o.max_size && - current_size == o.current_size && - average_queue_removal_time == o.average_queue_removal_time && - subresource_uris == o.subresource_uris - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account_id, queue_id, _alias, max_size, current_size, average_queue_removal_time, subresource_uris].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/queue_result_status.rb b/lib/freeclimb/models/queue_result_status.rb index f42f4204..613c2ca7 100644 --- a/lib/freeclimb/models/queue_result_status.rb +++ b/lib/freeclimb/models/queue_result_status.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/queue_wait_webhook.rb b/lib/freeclimb/models/queue_wait_webhook.rb new file mode 100644 index 00000000..726dd232 --- /dev/null +++ b/lib/freeclimb/models/queue_wait_webhook.rb @@ -0,0 +1,375 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + # A queued Call is requesting instructions to execute during the wait in the Queue and the corresponding waitUrl is being invoked. A PerCL response is expected. The following are the only PerCL commands supported in the PerCL script response to a request to the waitUrl: Play,Say,Pause,GetDigits,Dequeue,Hangup + class QueueWaitWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + QueueWaitWebhook.new(hash) + end + # Context or reason why this request is being made. Will be queueWait - A queued call is requesting instructions to execute during the wait in the queue and the corresponding waitUrl is being invoked. + attr_accessor :request_type + + # Account ID associated with your account. + attr_accessor :account_id + + # Unique identifier for this Call, generated by FreeClimb + attr_accessor :call_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number provisioned to the customer and to which this Call is directed (in E.164 format). + attr_accessor :to + + attr_accessor :call_status + + attr_accessor :direction + + # This is only populated if request pertains to a conference. Otherwise, it is set to null. + attr_accessor :conference_id + + # This is only populated if the request pertains to a queue. Otherwise, it is set to null. + attr_accessor :queue_id + + # Current queue position of the enqueued Call. + attr_accessor :queue_position + + # Time (in seconds) the Call spent in the Queue. This is only available if the Call was actually enqueued. + attr_accessor :queue_time + + # Current number of enqueued Calls in this Queue. + attr_accessor :current_queue_size + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'account_id' => :'accountId', + :'call_id' => :'callId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId', + :'queue_position' => :'queuePosition', + :'queue_time' => :'queueTime', + :'current_queue_size' => :'currentQueueSize' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'account_id' => :'String', + :'call_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String', + :'queue_position' => :'String', + :'queue_time' => :'Integer', + :'current_queue_size' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_status', + :'direction', + :'conference_id', + :'queue_id', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::QueueWaitWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::QueueWaitWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] + end + + if attributes.key?(:'queue_position') + self.queue_position = attributes[:'queue_position'] + end + + if attributes.key?(:'queue_time') + self.queue_time = attributes[:'queue_time'] + end + + if attributes.key?(:'current_queue_size') + self.current_queue_size = attributes[:'current_queue_size'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + account_id == o.account_id && + call_id == o.call_id && + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && + queue_position == o.queue_position && + queue_time == o.queue_time && + current_queue_size == o.current_queue_size && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, account_id, call_id, from, to, call_status, direction, conference_id, queue_id, queue_position, queue_time, current_queue_size].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/record_utterance.rb b/lib/freeclimb/models/record_utterance.rb index 95889794..199dec74 100644 --- a/lib/freeclimb/models/record_utterance.rb +++ b/lib/freeclimb/models/record_utterance.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -77,8 +77,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PerclCommand', - :'RecordUtteranceAllOf' + :'PerclCommand' ] end @@ -296,7 +295,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/record_utterance_all_of.rb b/lib/freeclimb/models/record_utterance_all_of.rb deleted file mode 100644 index a1dbcf0c..00000000 --- a/lib/freeclimb/models/record_utterance_all_of.rb +++ /dev/null @@ -1,288 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class RecordUtteranceAllOf - # URL to which information on the completed recording is submitted. The PerCL received in response is then used to continue with Call processing. - attr_accessor :action_url - - # Interval of silence that should elapse before ending the recording. - attr_accessor :silence_timeout_ms - - # Key that triggers the end of the recording. any digit, '#', or '*' - attr_accessor :finish_on_key - - # Maximum length for the command execution in seconds. - attr_accessor :max_length_sec - - # Indicates whether to play a beep sound before the start of the recording. If set to `false`, no beep is played. - attr_accessor :play_beep - - # If `false`, recording begins immediately after the RecordUtterance command is processed. If `true`, recording begins when audio is present and if audio begins before the `maxLengthSec` timeout. If no audio begins before `maxLengthSec`, no recording is generated. - attr_accessor :auto_start - - # Parameter `privacyMode` will not log the `text` as required by PCI compliance. - attr_accessor :privacy_mode - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'action_url' => :'actionUrl', - :'silence_timeout_ms' => :'silenceTimeoutMs', - :'finish_on_key' => :'finishOnKey', - :'max_length_sec' => :'maxLengthSec', - :'play_beep' => :'playBeep', - :'auto_start' => :'autoStart', - :'privacy_mode' => :'privacyMode' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'action_url' => :'String', - :'silence_timeout_ms' => :'Integer', - :'finish_on_key' => :'String', - :'max_length_sec' => :'Integer', - :'play_beep' => :'Boolean', - :'auto_start' => :'Boolean', - :'privacy_mode' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::RecordUtteranceAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::RecordUtteranceAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'action_url') - self.action_url = attributes[:'action_url'] - end - - if attributes.key?(:'silence_timeout_ms') - self.silence_timeout_ms = attributes[:'silence_timeout_ms'] - end - - if attributes.key?(:'finish_on_key') - self.finish_on_key = attributes[:'finish_on_key'] - end - - if attributes.key?(:'max_length_sec') - self.max_length_sec = attributes[:'max_length_sec'] - end - - if attributes.key?(:'play_beep') - self.play_beep = attributes[:'play_beep'] - end - - if attributes.key?(:'auto_start') - self.auto_start = attributes[:'auto_start'] - end - - if attributes.key?(:'privacy_mode') - self.privacy_mode = attributes[:'privacy_mode'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @action_url.nil? - invalid_properties.push('invalid value for "action_url", action_url cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @action_url.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - action_url == o.action_url && - silence_timeout_ms == o.silence_timeout_ms && - finish_on_key == o.finish_on_key && - max_length_sec == o.max_length_sec && - play_beep == o.play_beep && - auto_start == o.auto_start && - privacy_mode == o.privacy_mode - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [action_url, silence_timeout_ms, finish_on_key, max_length_sec, play_beep, auto_start, privacy_mode].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/record_utterance_term_reason.rb b/lib/freeclimb/models/record_utterance_term_reason.rb index c40afe37..934d524b 100644 --- a/lib/freeclimb/models/record_utterance_term_reason.rb +++ b/lib/freeclimb/models/record_utterance_term_reason.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/record_webhook.rb b/lib/freeclimb/models/record_webhook.rb new file mode 100644 index 00000000..ba48684e --- /dev/null +++ b/lib/freeclimb/models/record_webhook.rb @@ -0,0 +1,424 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + # The RecordUtterance command has completed and its actionUrl is being invoked. + class RecordWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + RecordWebhook.new(hash) + end + # The context or reason why this request is being made. Will be record - The RecordUtterance command has completed and its actionUrl is being invoked. + attr_accessor :request_type + + # Account ID associated with your account. + attr_accessor :account_id + + # Unique identifier for this Call, generated by FreeClimb + attr_accessor :call_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number provisioned to the customer and to which this Call is directed (in E.164 format). + attr_accessor :to + + attr_accessor :call_status + + attr_accessor :direction + + # This is only populated if request pertains to a conference. Otherwise, it is set to null. + attr_accessor :conference_id + + # This is only populated if the request pertains to a queue. Otherwise, it is set to null. + attr_accessor :queue_id + + # ID of the recording. + attr_accessor :recording_id + + # URL of the recorded audio file. This URL can be used as is in a Play command to play the recording (no authentication needed). It can also be used to download a recording file via the REST API. + attr_accessor :recording_url + + # Size of the recording in bytes + attr_accessor :recording_size + + # File type of the recording (audio/wav) + attr_accessor :recording_format + + # Duration of the recorded audio rounded up to the nearest second (in seconds) + attr_accessor :recording_duration_sec + + attr_accessor :term_reason + + # ID of Call that created this leg (child call). + attr_accessor :parent_call_id + + # If true then it indicates the recording will only be available for download for two minutes prior to it being deleted. This is to minimize risk of anyone else getting access to the url and attempting to access it. + attr_accessor :privacy_mode + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'account_id' => :'accountId', + :'call_id' => :'callId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId', + :'recording_id' => :'recordingId', + :'recording_url' => :'recordingUrl', + :'recording_size' => :'recordingSize', + :'recording_format' => :'recordingFormat', + :'recording_duration_sec' => :'recordingDurationSec', + :'term_reason' => :'termReason', + :'parent_call_id' => :'parentCallId', + :'privacy_mode' => :'privacyMode' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'account_id' => :'String', + :'call_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String', + :'recording_id' => :'String', + :'recording_url' => :'String', + :'recording_size' => :'String', + :'recording_format' => :'String', + :'recording_duration_sec' => :'Integer', + :'term_reason' => :'RecordUtteranceTermReason', + :'parent_call_id' => :'String', + :'privacy_mode' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_status', + :'direction', + :'conference_id', + :'queue_id', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::RecordWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::RecordWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] + end + + if attributes.key?(:'recording_id') + self.recording_id = attributes[:'recording_id'] + end + + if attributes.key?(:'recording_url') + self.recording_url = attributes[:'recording_url'] + end + + if attributes.key?(:'recording_size') + self.recording_size = attributes[:'recording_size'] + end + + if attributes.key?(:'recording_format') + self.recording_format = attributes[:'recording_format'] + end + + if attributes.key?(:'recording_duration_sec') + self.recording_duration_sec = attributes[:'recording_duration_sec'] + end + + if attributes.key?(:'term_reason') + self.term_reason = attributes[:'term_reason'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + + if attributes.key?(:'privacy_mode') + self.privacy_mode = attributes[:'privacy_mode'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + account_id == o.account_id && + call_id == o.call_id && + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && + recording_id == o.recording_id && + recording_url == o.recording_url && + recording_size == o.recording_size && + recording_format == o.recording_format && + recording_duration_sec == o.recording_duration_sec && + term_reason == o.term_reason && + parent_call_id == o.parent_call_id && + privacy_mode == o.privacy_mode && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, account_id, call_id, from, to, call_status, direction, conference_id, queue_id, recording_id, recording_url, recording_size, recording_format, recording_duration_sec, term_reason, parent_call_id, privacy_mode].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/recording_list.rb b/lib/freeclimb/models/recording_list.rb index 39e09a50..008ef5bc 100644 --- a/lib/freeclimb/models/recording_list.rb +++ b/lib/freeclimb/models/recording_list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -88,8 +88,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PaginationModel', - :'RecordingListAllOf' + :'PaginationModel' ] end @@ -305,7 +304,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/recording_list_all_of.rb b/lib/freeclimb/models/recording_list_all_of.rb deleted file mode 100644 index d837a501..00000000 --- a/lib/freeclimb/models/recording_list_all_of.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class RecordingListAllOf - attr_accessor :recordings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'recordings' => :'recordings' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'recordings' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'recordings' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::RecordingListAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::RecordingListAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'recordings') - if (value = attributes[:'recordings']).is_a?(Array) - self.recordings = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @recordings.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - recordings == o.recordings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [recordings].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/recording_result.rb b/lib/freeclimb/models/recording_result.rb index 1c98149b..a9507ef6 100644 --- a/lib/freeclimb/models/recording_result.rb +++ b/lib/freeclimb/models/recording_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -91,8 +91,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'MutableResourceModel', - :'RecordingResultAllOf' + :'MutableResourceModel' ] end @@ -311,7 +310,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/redirect.rb b/lib/freeclimb/models/redirect.rb index 5a14fa77..a452fd92 100644 --- a/lib/freeclimb/models/redirect.rb +++ b/lib/freeclimb/models/redirect.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -47,8 +47,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PerclCommand', - :'RedirectAllOf' + :'PerclCommand' ] end @@ -236,7 +235,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/redirect_all_of.rb b/lib/freeclimb/models/redirect_all_of.rb deleted file mode 100644 index 744960bd..00000000 --- a/lib/freeclimb/models/redirect_all_of.rb +++ /dev/null @@ -1,228 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class RedirectAllOf - # URL to request a new PerCL script to continue with the current Call's processing. When `Redirect` invokes the `actionUrl`, an `inbound` Webhook is sent. This request therefore looks identical to the initial request (made to the `voiceUrl` of the number that was called) for an inbound Call. - attr_accessor :action_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'action_url' => :'actionUrl' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'action_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::RedirectAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::RedirectAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'action_url') - self.action_url = attributes[:'action_url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @action_url.nil? - invalid_properties.push('invalid value for "action_url", action_url cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @action_url.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - action_url == o.action_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [action_url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/redirect_webhook.rb b/lib/freeclimb/models/redirect_webhook.rb new file mode 100644 index 00000000..97072103 --- /dev/null +++ b/lib/freeclimb/models/redirect_webhook.rb @@ -0,0 +1,355 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + # The Redirect command is executing and its actionUrl is being invoked. A PerCL response is expected. + class RedirectWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + RedirectWebhook.new(hash) + end + # Context or reason why this request is being made. Will be redirect - The Redirect command is executing and its actionUrl is being invoked. + attr_accessor :request_type + + # Account ID associated with your account. + attr_accessor :account_id + + # Unique identifier for this Call, generated by FreeClimb + attr_accessor :call_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number provisioned to the customer and to which this Call is directed (in E.164 format). + attr_accessor :to + + attr_accessor :call_status + + attr_accessor :direction + + # This is only populated if request pertains to a conference. Otherwise, it is set to null. + attr_accessor :conference_id + + # This is only populated if the request pertains to a queue. Otherwise, it is set to null. + attr_accessor :queue_id + + # ID of Call that created this leg (child call). + attr_accessor :parent_call_id + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'account_id' => :'accountId', + :'call_id' => :'callId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId', + :'parent_call_id' => :'parentCallId' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'account_id' => :'String', + :'call_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String', + :'parent_call_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_status', + :'direction', + :'conference_id', + :'queue_id', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::RedirectWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::RedirectWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] + end + + if attributes.key?(:'parent_call_id') + self.parent_call_id = attributes[:'parent_call_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + account_id == o.account_id && + call_id == o.call_id && + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && + parent_call_id == o.parent_call_id && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, account_id, call_id, from, to, call_status, direction, conference_id, queue_id, parent_call_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/reject.rb b/lib/freeclimb/models/reject.rb index 4dfff91c..2e7e5999 100644 --- a/lib/freeclimb/models/reject.rb +++ b/lib/freeclimb/models/reject.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -47,8 +47,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PerclCommand', - :'RejectAllOf' + :'PerclCommand' ] end @@ -232,7 +231,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/reject_all_of.rb b/lib/freeclimb/models/reject_all_of.rb deleted file mode 100644 index 5e4abf74..00000000 --- a/lib/freeclimb/models/reject_all_of.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class RejectAllOf - # Reason for the rejection. This can be any string value. In general, applications should use a set of enumerated values that are predefined to cover all exit points of the call flows for the given application. - attr_accessor :reason - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reason' => :'reason' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'reason' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::RejectAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::RejectAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reason') - self.reason = attributes[:'reason'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @reason.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reason == o.reason - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reason].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/remove_from_conference.rb b/lib/freeclimb/models/remove_from_conference.rb index 0d474d80..74c172f0 100644 --- a/lib/freeclimb/models/remove_from_conference.rb +++ b/lib/freeclimb/models/remove_from_conference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -217,7 +217,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/remove_from_queue_notification_webhook.rb b/lib/freeclimb/models/remove_from_queue_notification_webhook.rb new file mode 100644 index 00000000..9b9e3534 --- /dev/null +++ b/lib/freeclimb/models/remove_from_queue_notification_webhook.rb @@ -0,0 +1,364 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + # A call has been removed from a queue and the Enqueue command’s actionUrl is being invoked. A PerCL response is expected except if reason is hangup. + class RemoveFromQueueNotificationWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + RemoveFromQueueNotificationWebhook.new(hash) + end + # Context or reason why this request is being made. Will be removeFromQueueNotification - A Call has been removed from a Queue and the Enqueue command’s actionUrl is being invoked. + attr_accessor :request_type + + # Account ID associated with your account. + attr_accessor :account_id + + # Unique identifier for this Call, generated by FreeClimb + attr_accessor :call_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number provisioned to the customer and to which this Call is directed (in E.164 format). + attr_accessor :to + + attr_accessor :call_status + + attr_accessor :direction + + # This is only populated if request pertains to a conference. Otherwise, it is set to null. + attr_accessor :conference_id + + # This is only populated if the request pertains to a queue. Otherwise, it is set to null. + attr_accessor :queue_id + + attr_accessor :queue_result + + # Time (in seconds) the Call spent in the Queue. This is only available if the Call was actually enqueued. + attr_accessor :queue_time + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'account_id' => :'accountId', + :'call_id' => :'callId', + :'from' => :'from', + :'to' => :'to', + :'call_status' => :'callStatus', + :'direction' => :'direction', + :'conference_id' => :'conferenceId', + :'queue_id' => :'queueId', + :'queue_result' => :'queueResult', + :'queue_time' => :'queueTime' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'account_id' => :'String', + :'call_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'call_status' => :'CallStatus', + :'direction' => :'CallDirection', + :'conference_id' => :'String', + :'queue_id' => :'String', + :'queue_result' => :'QueueResultStatus', + :'queue_time' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'call_status', + :'direction', + :'conference_id', + :'queue_id', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::RemoveFromQueueNotificationWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::RemoveFromQueueNotificationWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'call_status') + self.call_status = attributes[:'call_status'] + end + + if attributes.key?(:'direction') + self.direction = attributes[:'direction'] + end + + if attributes.key?(:'conference_id') + self.conference_id = attributes[:'conference_id'] + end + + if attributes.key?(:'queue_id') + self.queue_id = attributes[:'queue_id'] + end + + if attributes.key?(:'queue_result') + self.queue_result = attributes[:'queue_result'] + end + + if attributes.key?(:'queue_time') + self.queue_time = attributes[:'queue_time'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + account_id == o.account_id && + call_id == o.call_id && + from == o.from && + to == o.to && + call_status == o.call_status && + direction == o.direction && + conference_id == o.conference_id && + queue_id == o.queue_id && + queue_result == o.queue_result && + queue_time == o.queue_time && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, account_id, call_id, from, to, call_status, direction, conference_id, queue_id, queue_result, queue_time].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/request_type.rb b/lib/freeclimb/models/request_type.rb index 2a529eda..bcac768e 100644 --- a/lib/freeclimb/models/request_type.rb +++ b/lib/freeclimb/models/request_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/say.rb b/lib/freeclimb/models/say.rb index ab56a3ec..4e5f7f1e 100644 --- a/lib/freeclimb/models/say.rb +++ b/lib/freeclimb/models/say.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -62,8 +62,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PerclCommand', - :'SayAllOf' + :'PerclCommand' ] end @@ -268,7 +267,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/say_all_of.rb b/lib/freeclimb/models/say_all_of.rb deleted file mode 100644 index b7f9d45f..00000000 --- a/lib/freeclimb/models/say_all_of.rb +++ /dev/null @@ -1,260 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class SayAllOf - # The message to be played to the caller using TTS. The size of the string is limited to 4 KB (or 4,096 bytes). An empty string will cause the command to be skipped. - attr_accessor :text - - # Language and (by implication) the locale to use. This implies the accent and pronunciations to be usde for the TTS. The complete list of valid values for the language attribute is shown below. - attr_accessor :language - - # Number of times the text is said. Specifying '0' causes the `Say` action to loop until the Call is hung up. - attr_accessor :loop - - # Parameter `privacyMode` will not log the `text` as required by PCI compliance. - attr_accessor :privacy_mode - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'text' => :'text', - :'language' => :'language', - :'loop' => :'loop', - :'privacy_mode' => :'privacyMode' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'text' => :'String', - :'language' => :'String', - :'loop' => :'Integer', - :'privacy_mode' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::SayAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::SayAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'text') - self.text = attributes[:'text'] - end - - if attributes.key?(:'language') - self.language = attributes[:'language'] - end - - if attributes.key?(:'loop') - self.loop = attributes[:'loop'] - else - self.loop = 1 - end - - if attributes.key?(:'privacy_mode') - self.privacy_mode = attributes[:'privacy_mode'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @text.nil? - invalid_properties.push('invalid value for "text", text cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @text.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - text == o.text && - language == o.language && - loop == o.loop && - privacy_mode == o.privacy_mode - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [text, language, loop, privacy_mode].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/send_digits.rb b/lib/freeclimb/models/send_digits.rb index 024573ef..b0bffd31 100644 --- a/lib/freeclimb/models/send_digits.rb +++ b/lib/freeclimb/models/send_digits.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -57,8 +57,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PerclCommand', - :'SendDigitsAllOf' + :'PerclCommand' ] end @@ -256,7 +255,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/send_digits_all_of.rb b/lib/freeclimb/models/send_digits_all_of.rb deleted file mode 100644 index c6f1df8b..00000000 --- a/lib/freeclimb/models/send_digits_all_of.rb +++ /dev/null @@ -1,248 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class SendDigitsAllOf - # String containing the digits to be played. The string cannot be empty and can include any digit, plus `#`, or `*`, and allows embedding specification for delay or pause between the output of individual digits. - attr_accessor :digits - - # Pause between digits in milliseconds. Valid values are 100-1000 milliseconds and will be adjusted by FreeClimb to satisfy the constraint. - attr_accessor :pause_ms - - # Parameter `privacyMode` will not log the `text` as required by PCI compliance. - attr_accessor :privacy_mode - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'digits' => :'digits', - :'pause_ms' => :'pauseMs', - :'privacy_mode' => :'privacyMode' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'digits' => :'String', - :'pause_ms' => :'Integer', - :'privacy_mode' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::SendDigitsAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::SendDigitsAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'digits') - self.digits = attributes[:'digits'] - end - - if attributes.key?(:'pause_ms') - self.pause_ms = attributes[:'pause_ms'] - end - - if attributes.key?(:'privacy_mode') - self.privacy_mode = attributes[:'privacy_mode'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @digits.nil? - invalid_properties.push('invalid value for "digits", digits cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @digits.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - digits == o.digits && - pause_ms == o.pause_ms && - privacy_mode == o.privacy_mode - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [digits, pause_ms, privacy_mode].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/set_dtmf_pass_through.rb b/lib/freeclimb/models/set_dtmf_pass_through.rb index 57548dc3..00f8cd53 100644 --- a/lib/freeclimb/models/set_dtmf_pass_through.rb +++ b/lib/freeclimb/models/set_dtmf_pass_through.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -47,8 +47,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PerclCommand', - :'SetDTMFPassThroughAllOf' + :'PerclCommand' ] end @@ -232,7 +231,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/set_dtmf_pass_through_all_of.rb b/lib/freeclimb/models/set_dtmf_pass_through_all_of.rb deleted file mode 100644 index 52a8606c..00000000 --- a/lib/freeclimb/models/set_dtmf_pass_through_all_of.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class SetDTMFPassThroughAllOf - # Specifying `false` mutes the Participant's dtmf audio. - attr_accessor :dtmf_pass_through - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'dtmf_pass_through' => :'dtmfPassThrough' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'dtmf_pass_through' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::SetDTMFPassThroughAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::SetDTMFPassThroughAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'dtmf_pass_through') - self.dtmf_pass_through = attributes[:'dtmf_pass_through'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @dtmf_pass_through.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - dtmf_pass_through == o.dtmf_pass_through - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [dtmf_pass_through].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/set_listen.rb b/lib/freeclimb/models/set_listen.rb index 4956795c..b4867e34 100644 --- a/lib/freeclimb/models/set_listen.rb +++ b/lib/freeclimb/models/set_listen.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -47,8 +47,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PerclCommand', - :'SetListenAllOf' + :'PerclCommand' ] end @@ -232,7 +231,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/set_listen_all_of.rb b/lib/freeclimb/models/set_listen_all_of.rb deleted file mode 100644 index 6400d170..00000000 --- a/lib/freeclimb/models/set_listen_all_of.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class SetListenAllOf - # Specifying `false` will silence the Conference for this Participant. - attr_accessor :listen - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'listen' => :'listen' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'listen' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::SetListenAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::SetListenAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'listen') - self.listen = attributes[:'listen'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @listen.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - listen == o.listen - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [listen].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/set_talk.rb b/lib/freeclimb/models/set_talk.rb index fb3bed19..0c7082f8 100644 --- a/lib/freeclimb/models/set_talk.rb +++ b/lib/freeclimb/models/set_talk.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -47,8 +47,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PerclCommand', - :'SetTalkAllOf' + :'PerclCommand' ] end @@ -232,7 +231,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/set_talk_all_of.rb b/lib/freeclimb/models/set_talk_all_of.rb deleted file mode 100644 index 61d2c551..00000000 --- a/lib/freeclimb/models/set_talk_all_of.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class SetTalkAllOf - # Specifying `false` mutes the Participant. - attr_accessor :talk - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'talk' => :'talk' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'talk' => :'Boolean' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::SetTalkAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::SetTalkAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'talk') - self.talk = attributes[:'talk'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @talk.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - talk == o.talk - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [talk].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/sms.rb b/lib/freeclimb/models/sms.rb index 399b3c76..7c7a9b34 100644 --- a/lib/freeclimb/models/sms.rb +++ b/lib/freeclimb/models/sms.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -62,8 +62,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PerclCommand', - :'SmsAllOf' + :'PerclCommand' ] end @@ -274,7 +273,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/sms_all_of.rb b/lib/freeclimb/models/sms_all_of.rb deleted file mode 100644 index 13890cdb..00000000 --- a/lib/freeclimb/models/sms_all_of.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class SmsAllOf - # E.164 representation of the phone number to which the message will be sent. Must be within FreeClimb's service area and E.164 formatting (e.g., +18003608245). - attr_accessor :to - - # E.164 representation of the phone number to use as the sender. This must be an incoming phone number you have purchased from FreeClimb. - attr_accessor :from - - # Text contained in the message (maximum 160 characters). - attr_accessor :text - - # When the message changes status, this URL will be invoked using HTTP POST with the messageStatus parameters. This is a notification only; any PerCL returned will be ignored. - attr_accessor :notification_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'to' => :'to', - :'from' => :'from', - :'text' => :'text', - :'notification_url' => :'notificationUrl' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'to' => :'String', - :'from' => :'String', - :'text' => :'String', - :'notification_url' => :'String' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::SmsAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::SmsAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'to') - self.to = attributes[:'to'] - end - - if attributes.key?(:'from') - self.from = attributes[:'from'] - end - - if attributes.key?(:'text') - self.text = attributes[:'text'] - end - - if attributes.key?(:'notification_url') - self.notification_url = attributes[:'notification_url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @to.nil? - invalid_properties.push('invalid value for "to", to cannot be nil.') - end - - if @from.nil? - invalid_properties.push('invalid value for "from", from cannot be nil.') - end - - if @text.nil? - invalid_properties.push('invalid value for "text", text cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @to.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - to == o.to && - from == o.from && - text == o.text && - notification_url == o.notification_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [to, from, text, notification_url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/sms_ten_dlc_brand.rb b/lib/freeclimb/models/sms_ten_dlc_brand.rb index f45c4ce7..7e23a761 100644 --- a/lib/freeclimb/models/sms_ten_dlc_brand.rb +++ b/lib/freeclimb/models/sms_ten_dlc_brand.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -19,7 +19,6 @@ class SMSTenDLCBrand # ID of the account that created this Queue. attr_accessor :account_id - # Entity type behind the brand. This is the form of business establishment. attr_accessor :entity_type # Unique identifier assigned to the csp by the registry. @@ -70,7 +69,6 @@ class SMSTenDLCBrand # (Required for public company) stock symbol. attr_accessor :stock_symbol - # (Required for public company) stock exchange. attr_accessor :stock_exchange # IP address of the browser requesting to create brand identity. @@ -79,7 +77,6 @@ class SMSTenDLCBrand # Brand website URL. attr_accessor :website - # Brand relationship to the CSP attr_accessor :brand_relationship # Vertical or industry segment of the brand. @@ -88,7 +85,6 @@ class SMSTenDLCBrand # Alternate business identifier such as DUNS, LEI, or GIIN attr_accessor :alt_business_id - # The type of the Alternative business identifier attr_accessor :alt_business_id_type # Universal EIN of Brand, Read Only. @@ -103,7 +99,6 @@ class SMSTenDLCBrand # Test brand. attr_accessor :mock - # TCR assessment of the brand identification status. attr_accessor :identity_status # Unix timestamp when brand was created. @@ -177,7 +172,7 @@ def self.acceptable_attributes def self.openapi_types { :'account_id' => :'String', - :'entity_type' => :'String', + :'entity_type' => :'SMSTenDLCBrandEntityType', :'csp_id' => :'String', :'brand_id' => :'String', :'first_name' => :'String', @@ -194,18 +189,18 @@ def self.openapi_types :'country' => :'String', :'email' => :'String', :'stock_symbol' => :'String', - :'stock_exchange' => :'String', + :'stock_exchange' => :'SMSTenDLCBrandStockExchange', :'ip_address' => :'String', :'website' => :'String', - :'brand_relationship' => :'String', + :'brand_relationship' => :'SMSTenDLCBrandRelationship', :'vertical' => :'String', :'alt_business_id' => :'String', - :'alt_business_id_type' => :'String', + :'alt_business_id_type' => :'SMSTenDLCBrandAltBusinessIdType', :'universal_ein' => :'String', :'reference_id' => :'String', :'optional_attributes' => :'Hash', :'mock' => :'Boolean', - :'identity_status' => :'String', + :'identity_status' => :'SMSTenDLCBrandIdentityStatus', :'create_date' => :'Time' } end @@ -367,10 +362,6 @@ def list_invalid_properties invalid_properties.push('invalid value for "entity_type", entity_type cannot be nil.') end - if @entity_type.to_s.length > 20 - invalid_properties.push('invalid value for "entity_type", the character length must be smaller than or equal to 20.') - end - if !@first_name.nil? && @first_name.to_s.length > 100 invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 100.') end @@ -493,16 +484,6 @@ def valid? end end - # Custom attribute writer method checking allowed values (enum). - # @param [Object] entity_type Object to be assigned - def entity_type=(entity_type) - validator = EnumAttributeValidator.new('String', ["PRIVATE_PROFIT", "PUBLIC_PROFIT", "NON_PROFIT", "GOVERNMENT", "SOLE_PROPRIETOR"]) - unless validator.valid?(entity_type) - fail ArgumentError, "invalid value for \"entity_type\", must be one of #{validator.allowable_values}." - end - @entity_type = entity_type - end - # Custom attribute writer method with validation # @param [Object] first_name Value to be assigned def first_name=(first_name) @@ -659,16 +640,6 @@ def stock_symbol=(stock_symbol) @stock_symbol = stock_symbol end - # Custom attribute writer method checking allowed values (enum). - # @param [Object] stock_exchange Object to be assigned - def stock_exchange=(stock_exchange) - validator = EnumAttributeValidator.new('String', ["NONE", "NASDAQ", "NYSE", "AMEX", "AMX", "ASX", "B3", "BME", "BSE", "FRA", "ICEX", "JPX", "JSE", "KRX", "LON", "NSE", "OMX", "SEHK", "SGX", "SSE", "STO", "SWX", "SZSE", "TSX", "TWSE", "VSE", "OTHER"]) - unless validator.valid?(stock_exchange) - fail ArgumentError, "invalid value for \"stock_exchange\", must be one of #{validator.allowable_values}." - end - @stock_exchange = stock_exchange - end - # Custom attribute writer method with validation # @param [Object] ip_address Value to be assigned def ip_address=(ip_address) @@ -689,16 +660,6 @@ def website=(website) @website = website end - # Custom attribute writer method checking allowed values (enum). - # @param [Object] brand_relationship Object to be assigned - def brand_relationship=(brand_relationship) - validator = EnumAttributeValidator.new('String', ["BASIC_ACCOUNT", "SMALL_ACCOUNT", "MEDIUM_ACCOUNT", "LARGE_ACCOUNT", "KEY_ACCOUNT"]) - unless validator.valid?(brand_relationship) - fail ArgumentError, "invalid value for \"brand_relationship\", must be one of #{validator.allowable_values}." - end - @brand_relationship = brand_relationship - end - # Custom attribute writer method with validation # @param [Object] vertical Value to be assigned def vertical=(vertical) @@ -723,16 +684,6 @@ def alt_business_id=(alt_business_id) @alt_business_id = alt_business_id end - # Custom attribute writer method checking allowed values (enum). - # @param [Object] alt_business_id_type Object to be assigned - def alt_business_id_type=(alt_business_id_type) - validator = EnumAttributeValidator.new('String', ["NONE", "DUNS", "GIIN", "LEI"]) - unless validator.valid?(alt_business_id_type) - fail ArgumentError, "invalid value for \"alt_business_id_type\", must be one of #{validator.allowable_values}." - end - @alt_business_id_type = alt_business_id_type - end - # Custom attribute writer method with validation # @param [Object] reference_id Value to be assigned def reference_id=(reference_id) @@ -743,16 +694,6 @@ def reference_id=(reference_id) @reference_id = reference_id end - # Custom attribute writer method checking allowed values (enum). - # @param [Object] identity_status Object to be assigned - def identity_status=(identity_status) - validator = EnumAttributeValidator.new('String', ["SELF_DECLARED", "UNVERIFIED", "VERIFIED", "VETTED_VERIFIED"]) - unless validator.valid?(identity_status) - fail ArgumentError, "invalid value for \"identity_status\", must be one of #{validator.allowable_values}." - end - @identity_status = identity_status - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -920,7 +861,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/sms_ten_dlc_brand_alt_business_id_type.rb b/lib/freeclimb/models/sms_ten_dlc_brand_alt_business_id_type.rb new file mode 100644 index 00000000..84ef941d --- /dev/null +++ b/lib/freeclimb/models/sms_ten_dlc_brand_alt_business_id_type.rb @@ -0,0 +1,39 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + class SMSTenDLCBrandAltBusinessIdType + NONE = "NONE".freeze + DUNS = "DUNS".freeze + GIIN = "GIIN".freeze + LEI = "LEI".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = SMSTenDLCBrandAltBusinessIdType.constants.select { |c| SMSTenDLCBrandAltBusinessIdType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SMSTenDLCBrandAltBusinessIdType" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/models/sms_ten_dlc_brand_entity_type.rb b/lib/freeclimb/models/sms_ten_dlc_brand_entity_type.rb new file mode 100644 index 00000000..225a3339 --- /dev/null +++ b/lib/freeclimb/models/sms_ten_dlc_brand_entity_type.rb @@ -0,0 +1,40 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + class SMSTenDLCBrandEntityType + PRIVATE_PROFIT = "PRIVATE_PROFIT".freeze + PUBLIC_PROFIT = "PUBLIC_PROFIT".freeze + NON_PROFIT = "NON_PROFIT".freeze + GOVERNMENT = "GOVERNMENT".freeze + SOLE_PROPRIETOR = "SOLE_PROPRIETOR".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = SMSTenDLCBrandEntityType.constants.select { |c| SMSTenDLCBrandEntityType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SMSTenDLCBrandEntityType" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/models/sms_ten_dlc_brand_identity_status.rb b/lib/freeclimb/models/sms_ten_dlc_brand_identity_status.rb new file mode 100644 index 00000000..959afb6f --- /dev/null +++ b/lib/freeclimb/models/sms_ten_dlc_brand_identity_status.rb @@ -0,0 +1,39 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + class SMSTenDLCBrandIdentityStatus + SELF_DECLARED = "SELF_DECLARED".freeze + UNVERIFIED = "UNVERIFIED".freeze + VERIFIED = "VERIFIED".freeze + VETTED_VERIFIED = "VETTED_VERIFIED".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = SMSTenDLCBrandIdentityStatus.constants.select { |c| SMSTenDLCBrandIdentityStatus::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SMSTenDLCBrandIdentityStatus" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/models/sms_ten_dlc_brand_relationship.rb b/lib/freeclimb/models/sms_ten_dlc_brand_relationship.rb new file mode 100644 index 00000000..ee11b4b2 --- /dev/null +++ b/lib/freeclimb/models/sms_ten_dlc_brand_relationship.rb @@ -0,0 +1,40 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + class SMSTenDLCBrandRelationship + BASIC_ACCOUNT = "BASIC_ACCOUNT".freeze + SMALL_ACCOUNT = "SMALL_ACCOUNT".freeze + MEDIUM_ACCOUNT = "MEDIUM_ACCOUNT".freeze + LARGE_ACCOUNT = "LARGE_ACCOUNT".freeze + KEY_ACCOUNT = "KEY_ACCOUNT".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = SMSTenDLCBrandRelationship.constants.select { |c| SMSTenDLCBrandRelationship::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SMSTenDLCBrandRelationship" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/models/sms_ten_dlc_brand_stock_exchange.rb b/lib/freeclimb/models/sms_ten_dlc_brand_stock_exchange.rb new file mode 100644 index 00000000..4654b39e --- /dev/null +++ b/lib/freeclimb/models/sms_ten_dlc_brand_stock_exchange.rb @@ -0,0 +1,62 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + class SMSTenDLCBrandStockExchange + NONE = "NONE".freeze + NASDAQ = "NASDAQ".freeze + NYSE = "NYSE".freeze + AMEX = "AMEX".freeze + AMX = "AMX".freeze + ASX = "ASX".freeze + B3 = "B3".freeze + BME = "BME".freeze + BSE = "BSE".freeze + FRA = "FRA".freeze + ICEX = "ICEX".freeze + JPX = "JPX".freeze + JSE = "JSE".freeze + KRX = "KRX".freeze + LON = "LON".freeze + NSE = "NSE".freeze + OMX = "OMX".freeze + SEHK = "SEHK".freeze + SGX = "SGX".freeze + SSE = "SSE".freeze + STO = "STO".freeze + SWX = "SWX".freeze + SZSE = "SZSE".freeze + TSX = "TSX".freeze + TWSE = "TWSE".freeze + VSE = "VSE".freeze + OTHER = "OTHER".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = SMSTenDLCBrandStockExchange.constants.select { |c| SMSTenDLCBrandStockExchange::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SMSTenDLCBrandStockExchange" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/models/sms_ten_dlc_brands_list_result.rb b/lib/freeclimb/models/sms_ten_dlc_brands_list_result.rb index 1233b531..38031b50 100644 --- a/lib/freeclimb/models/sms_ten_dlc_brands_list_result.rb +++ b/lib/freeclimb/models/sms_ten_dlc_brands_list_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -88,8 +88,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PaginationModel', - :'SMSTenDLCBrandsListResultAllOf' + :'PaginationModel' ] end @@ -305,7 +304,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/sms_ten_dlc_brands_list_result_all_of.rb b/lib/freeclimb/models/sms_ten_dlc_brands_list_result_all_of.rb deleted file mode 100644 index 28ab19fd..00000000 --- a/lib/freeclimb/models/sms_ten_dlc_brands_list_result_all_of.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class SMSTenDLCBrandsListResultAllOf - attr_accessor :brands - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'brands' => :'brands' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'brands' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'brands' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::SMSTenDLCBrandsListResultAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::SMSTenDLCBrandsListResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'brands') - if (value = attributes[:'brands']).is_a?(Array) - self.brands = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @brands.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - brands == o.brands - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [brands].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/sms_ten_dlc_campaign.rb b/lib/freeclimb/models/sms_ten_dlc_campaign.rb index a6e6f2d1..18f37e4c 100644 --- a/lib/freeclimb/models/sms_ten_dlc_campaign.rb +++ b/lib/freeclimb/models/sms_ten_dlc_campaign.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -27,7 +27,6 @@ class SMSTenDLCCampaign # Alphanumeric identifier of the reseller that you want to associate with this campaign. attr_accessor :reseller_id - # Current campaign status. Possible values: ACTIVE, EXPIRED. A newly created campaign defaults to ACTIVE status. attr_accessor :status # Unix timestamp when campaign was created. @@ -198,7 +197,7 @@ def self.openapi_types :'campaign_id' => :'String', :'csp_id' => :'String', :'reseller_id' => :'String', - :'status' => :'String', + :'status' => :'SMSTenDLCCampaignStatus', :'create_date' => :'Time', :'auto_renewal' => :'Boolean', :'billed_date' => :'Time', @@ -548,16 +547,6 @@ def reseller_id=(reseller_id) @reseller_id = reseller_id end - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["ACTIVE", "EXPIRED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - # Custom attribute writer method with validation # @param [Object] brand_id Value to be assigned def brand_id=(brand_id) @@ -912,7 +901,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/sms_ten_dlc_campaign_status.rb b/lib/freeclimb/models/sms_ten_dlc_campaign_status.rb new file mode 100644 index 00000000..da232cfd --- /dev/null +++ b/lib/freeclimb/models/sms_ten_dlc_campaign_status.rb @@ -0,0 +1,37 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + class SMSTenDLCCampaignStatus + ACTIVE = "ACTIVE".freeze + EXPIRED = "EXPIRED".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = SMSTenDLCCampaignStatus.constants.select { |c| SMSTenDLCCampaignStatus::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SMSTenDLCCampaignStatus" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/models/sms_ten_dlc_campaigns_list_result.rb b/lib/freeclimb/models/sms_ten_dlc_campaigns_list_result.rb index fcbea5ff..1aa66d6b 100644 --- a/lib/freeclimb/models/sms_ten_dlc_campaigns_list_result.rb +++ b/lib/freeclimb/models/sms_ten_dlc_campaigns_list_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -88,8 +88,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PaginationModel', - :'SMSTenDLCCampaignsListResultAllOf' + :'PaginationModel' ] end @@ -305,7 +304,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/sms_ten_dlc_campaigns_list_result_all_of.rb b/lib/freeclimb/models/sms_ten_dlc_campaigns_list_result_all_of.rb deleted file mode 100644 index 0979de36..00000000 --- a/lib/freeclimb/models/sms_ten_dlc_campaigns_list_result_all_of.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class SMSTenDLCCampaignsListResultAllOf - attr_accessor :campaigns - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'campaigns' => :'campaigns' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'campaigns' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'campaigns' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::SMSTenDLCCampaignsListResultAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::SMSTenDLCCampaignsListResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'campaigns') - if (value = attributes[:'campaigns']).is_a?(Array) - self.campaigns = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @campaigns.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - campaigns == o.campaigns - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [campaigns].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/sms_ten_dlc_partner_campaign.rb b/lib/freeclimb/models/sms_ten_dlc_partner_campaign.rb index 6a623cb9..57cac396 100644 --- a/lib/freeclimb/models/sms_ten_dlc_partner_campaign.rb +++ b/lib/freeclimb/models/sms_ten_dlc_partner_campaign.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -21,7 +21,6 @@ class SMSTenDLCPartnerCampaign # Alphanumeric identifier assigned by the registry for a campaign. This identifier is required by the NetNumber OSR SMS enabling process of 10DLC. attr_accessor :campaign_id - # Current campaign status. Possible values: ACTIVE, EXPIRED. A newly created campaign defaults to ACTIVE status. attr_accessor :status # Unix timestamp when campaign was created. @@ -167,7 +166,7 @@ def self.openapi_types { :'account_id' => :'String', :'campaign_id' => :'String', - :'status' => :'String', + :'status' => :'SMSTenDLCPartnerCampaignStatus', :'create_date' => :'Time', :'brand_id' => :'String', :'usecase' => :'String', @@ -448,16 +447,6 @@ def valid? end end - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["ACTIVE", "EXPIRED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - # Custom attribute writer method with validation # @param [Object] brand_id Value to be assigned def brand_id=(brand_id) @@ -785,7 +774,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/sms_ten_dlc_partner_campaign_brand.rb b/lib/freeclimb/models/sms_ten_dlc_partner_campaign_brand.rb index 7ceb995d..7a62dded 100644 --- a/lib/freeclimb/models/sms_ten_dlc_partner_campaign_brand.rb +++ b/lib/freeclimb/models/sms_ten_dlc_partner_campaign_brand.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -435,7 +435,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/sms_ten_dlc_partner_campaign_status.rb b/lib/freeclimb/models/sms_ten_dlc_partner_campaign_status.rb new file mode 100644 index 00000000..7af06177 --- /dev/null +++ b/lib/freeclimb/models/sms_ten_dlc_partner_campaign_status.rb @@ -0,0 +1,37 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + class SMSTenDLCPartnerCampaignStatus + ACTIVE = "ACTIVE".freeze + EXPIRED = "EXPIRED".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = SMSTenDLCPartnerCampaignStatus.constants.select { |c| SMSTenDLCPartnerCampaignStatus::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SMSTenDLCPartnerCampaignStatus" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/models/sms_ten_dlc_partner_campaigns_list_result.rb b/lib/freeclimb/models/sms_ten_dlc_partner_campaigns_list_result.rb index 2fb333c1..50e41d55 100644 --- a/lib/freeclimb/models/sms_ten_dlc_partner_campaigns_list_result.rb +++ b/lib/freeclimb/models/sms_ten_dlc_partner_campaigns_list_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -88,8 +88,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PaginationModel', - :'SMSTenDLCPartnerCampaignsListResultAllOf' + :'PaginationModel' ] end @@ -305,7 +304,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/sms_ten_dlc_partner_campaigns_list_result_all_of.rb b/lib/freeclimb/models/sms_ten_dlc_partner_campaigns_list_result_all_of.rb deleted file mode 100644 index 6dfbc48a..00000000 --- a/lib/freeclimb/models/sms_ten_dlc_partner_campaigns_list_result_all_of.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class SMSTenDLCPartnerCampaignsListResultAllOf - attr_accessor :partner_campaigns - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'partner_campaigns' => :'partnerCampaigns' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'partner_campaigns' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'partner_campaigns' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::SMSTenDLCPartnerCampaignsListResultAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::SMSTenDLCPartnerCampaignsListResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'partner_campaigns') - if (value = attributes[:'partner_campaigns']).is_a?(Array) - self.partner_campaigns = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @partner_campaigns.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - partner_campaigns == o.partner_campaigns - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [partner_campaigns].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/sms_toll_free_campaign.rb b/lib/freeclimb/models/sms_toll_free_campaign.rb index 6906974a..170dfec6 100644 --- a/lib/freeclimb/models/sms_toll_free_campaign.rb +++ b/lib/freeclimb/models/sms_toll_free_campaign.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -23,7 +23,6 @@ class SMSTollFreeCampaign attr_accessor :use_case - # Current toll-free campaign registration status.Possible values: UNREGISTERED,INITIATED,PENDING,DECLINED,REGISTERED. A newly created campaign defaults to INITIATED status. attr_accessor :registration_status attr_accessor :date_created @@ -78,7 +77,7 @@ def self.openapi_types :'account_id' => :'String', :'campaign_id' => :'String', :'use_case' => :'String', - :'registration_status' => :'String', + :'registration_status' => :'SMSTollFreeCampaignRegistrationStatus', :'date_created' => :'String', :'date_updated' => :'String', :'revision' => :'Integer' @@ -178,16 +177,6 @@ def valid? end end - # Custom attribute writer method checking allowed values (enum). - # @param [Object] registration_status Object to be assigned - def registration_status=(registration_status) - validator = EnumAttributeValidator.new('String', ["UNREGISTERED", "INITIATED", "PENDING", "DECLINED", "REGISTERED"]) - unless validator.valid?(registration_status) - fail ArgumentError, "invalid value for \"registration_status\", must be one of #{validator.allowable_values}." - end - @registration_status = registration_status - end - # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -331,7 +320,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/sms_toll_free_campaign_registration_status.rb b/lib/freeclimb/models/sms_toll_free_campaign_registration_status.rb new file mode 100644 index 00000000..e2af53da --- /dev/null +++ b/lib/freeclimb/models/sms_toll_free_campaign_registration_status.rb @@ -0,0 +1,40 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + class SMSTollFreeCampaignRegistrationStatus + UNREGISTERED = "UNREGISTERED".freeze + INITIATED = "INITIATED".freeze + PENDING = "PENDING".freeze + DECLINED = "DECLINED".freeze + REGISTERED = "REGISTERED".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = SMSTollFreeCampaignRegistrationStatus.constants.select { |c| SMSTollFreeCampaignRegistrationStatus::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SMSTollFreeCampaignRegistrationStatus" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/models/sms_toll_free_campaigns_list_result.rb b/lib/freeclimb/models/sms_toll_free_campaigns_list_result.rb index c16b2dfa..9485d60c 100644 --- a/lib/freeclimb/models/sms_toll_free_campaigns_list_result.rb +++ b/lib/freeclimb/models/sms_toll_free_campaigns_list_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -88,8 +88,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PaginationModel', - :'SMSTollFreeCampaignsListResultAllOf' + :'PaginationModel' ] end @@ -305,7 +304,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/sms_toll_free_campaigns_list_result_all_of.rb b/lib/freeclimb/models/sms_toll_free_campaigns_list_result_all_of.rb deleted file mode 100644 index e0fc4ffa..00000000 --- a/lib/freeclimb/models/sms_toll_free_campaigns_list_result_all_of.rb +++ /dev/null @@ -1,226 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - class SMSTollFreeCampaignsListResultAllOf - attr_accessor :brands - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'brands' => :'brands' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'brands' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'brands' - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::SMSTollFreeCampaignsListResultAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::SMSTollFreeCampaignsListResultAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'brands') - if (value = attributes[:'brands']).is_a?(Array) - self.brands = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @brands.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - brands == o.brands - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [brands].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/start_record_call.rb b/lib/freeclimb/models/start_record_call.rb index 59fb04cc..78cbd410 100644 --- a/lib/freeclimb/models/start_record_call.rb +++ b/lib/freeclimb/models/start_record_call.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -217,7 +217,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/terminate_conference.rb b/lib/freeclimb/models/terminate_conference.rb index 81917b5f..a9ba6c2c 100644 --- a/lib/freeclimb/models/terminate_conference.rb +++ b/lib/freeclimb/models/terminate_conference.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -217,7 +217,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/tfn.rb b/lib/freeclimb/models/tfn.rb index e2ca4a68..0fb93abc 100644 --- a/lib/freeclimb/models/tfn.rb +++ b/lib/freeclimb/models/tfn.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -223,7 +223,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/transcribe_reason.rb b/lib/freeclimb/models/transcribe_reason.rb new file mode 100644 index 00000000..3975737d --- /dev/null +++ b/lib/freeclimb/models/transcribe_reason.rb @@ -0,0 +1,40 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + class TranscribeReason + INTERNAL_ERROR = "internalError".freeze + HANGUP = "hangup".freeze + MAX_LENGTH = "maxLength".freeze + DIGIT = "digit".freeze + NO_INPUT = "noInput".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = TranscribeReason.constants.select { |c| TranscribeReason::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #TranscribeReason" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/models/transcribe_term_reason.rb b/lib/freeclimb/models/transcribe_term_reason.rb new file mode 100644 index 00000000..89664b34 --- /dev/null +++ b/lib/freeclimb/models/transcribe_term_reason.rb @@ -0,0 +1,37 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + class TranscribeTermReason + ERROR = "error".freeze + COMPLETED = "completed".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = TranscribeTermReason.constants.select { |c| TranscribeTermReason::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #TranscribeTermReason" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/models/transcribe_utterance.rb b/lib/freeclimb/models/transcribe_utterance.rb index 90651a72..23a3de17 100644 --- a/lib/freeclimb/models/transcribe_utterance.rb +++ b/lib/freeclimb/models/transcribe_utterance.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -50,10 +50,10 @@ def self.openapi_types { :'action_url' => :'String', :'play_beep' => :'Boolean', - :'record' => :'TranscribeUtteranceAllOfRecord', + :'record' => :'TranscribeUtteranceRecord', :'privacy_for_logging' => :'Boolean', :'privacy_for_recording' => :'Boolean', - :'prompts' => :'Array' + :'prompts' => :'Array' } end @@ -66,8 +66,7 @@ def self.openapi_nullable # List of class defined in allOf (OpenAPI v3) def self.openapi_all_of [ - :'PerclCommand', - :'TranscribeUtteranceAllOf' + :'PerclCommand' ] end @@ -288,7 +287,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/transcribe_utterance_all_of.rb b/lib/freeclimb/models/transcribe_utterance_all_of.rb deleted file mode 100644 index 34b0c402..00000000 --- a/lib/freeclimb/models/transcribe_utterance_all_of.rb +++ /dev/null @@ -1,281 +0,0 @@ -=begin -#FreeClimb API - -#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. - -The version of the OpenAPI document: 1.0.0 -Contact: support@freeclimb.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 - -=end - -require 'date' -require 'time' - -module Freeclimb - # The `TranscribeUtterance` command transcribes the caller’s voice and returns transcription of the audio and optionally returns the recording of the audio transcribed. `TranscribeUtterance` is blocking and is a terminal command. As such, the actionUrl property is required, and control of the Call picks up using the `PerCL` returned in response of the `actionUrl`. Recording and Transcription information is returned in the actionUrl request. If the reason this command ended was due to the call hanging up, any PerCL returned will not execute. - class TranscribeUtteranceAllOf - attr_accessor :action_url - - attr_accessor :play_beep - - attr_accessor :record - - attr_accessor :privacy_for_logging - - attr_accessor :privacy_for_recording - - attr_accessor :prompts - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'action_url' => :'actionUrl', - :'play_beep' => :'playBeep', - :'record' => :'record', - :'privacy_for_logging' => :'privacyForLogging', - :'privacy_for_recording' => :'privacyForRecording', - :'prompts' => :'prompts' - } - end - - # Returns all the JSON keys this model knows about - def self.acceptable_attributes - attribute_map.values - end - - # Attribute type mapping. - def self.openapi_types - { - :'action_url' => :'String', - :'play_beep' => :'Boolean', - :'record' => :'TranscribeUtteranceAllOfRecord', - :'privacy_for_logging' => :'Boolean', - :'privacy_for_recording' => :'Boolean', - :'prompts' => :'Array' - } - end - - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::TranscribeUtteranceAllOf` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::TranscribeUtteranceAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'action_url') - self.action_url = attributes[:'action_url'] - end - - if attributes.key?(:'play_beep') - self.play_beep = attributes[:'play_beep'] - else - self.play_beep = false - end - - if attributes.key?(:'record') - self.record = attributes[:'record'] - end - - if attributes.key?(:'privacy_for_logging') - self.privacy_for_logging = attributes[:'privacy_for_logging'] - else - self.privacy_for_logging = false - end - - if attributes.key?(:'privacy_for_recording') - self.privacy_for_recording = attributes[:'privacy_for_recording'] - else - self.privacy_for_recording = false - end - - if attributes.key?(:'prompts') - if (value = attributes[:'prompts']).is_a?(Array) - self.prompts = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @action_url.nil? - invalid_properties.push('invalid value for "action_url", action_url cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - - if @action_url.nil? - false - else - list_invalid_properties.length() == 0 - end - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - action_url == o.action_url && - play_beep == o.play_beep && - record == o.record && - privacy_for_logging == o.privacy_for_logging && - privacy_for_recording == o.privacy_for_recording && - prompts == o.prompts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [action_url, play_beep, record, privacy_for_logging, privacy_for_recording, prompts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - elsif type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :Time - Time.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - # models (e.g. Pet) or oneOf - klass = Freeclimb.const_get(type) - klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end - -end diff --git a/lib/freeclimb/models/transcribe_utterance_all_of_record.rb b/lib/freeclimb/models/transcribe_utterance_record.rb similarity index 95% rename from lib/freeclimb/models/transcribe_utterance_all_of_record.rb rename to lib/freeclimb/models/transcribe_utterance_record.rb index 3770824f..5a018d6a 100644 --- a/lib/freeclimb/models/transcribe_utterance_all_of_record.rb +++ b/lib/freeclimb/models/transcribe_utterance_record.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -14,7 +14,7 @@ require 'time' module Freeclimb - class TranscribeUtteranceAllOfRecord + class TranscribeUtteranceRecord attr_accessor :save_recording attr_accessor :max_length_sec @@ -54,13 +54,13 @@ def self.openapi_nullable # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::TranscribeUtteranceAllOfRecord` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::TranscribeUtteranceRecord` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::TranscribeUtteranceAllOfRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::TranscribeUtteranceRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } @@ -98,8 +98,8 @@ def list_invalid_properties invalid_properties.push('invalid value for "rcrd_termination_silence_time_ms", must be smaller than or equal to 3000.') end - if !@rcrd_termination_silence_time_ms.nil? && @rcrd_termination_silence_time_ms <= 0 - invalid_properties.push('invalid value for "rcrd_termination_silence_time_ms", must be greater than 0.') + if !@rcrd_termination_silence_time_ms.nil? && @rcrd_termination_silence_time_ms < 1 + invalid_properties.push('invalid value for "rcrd_termination_silence_time_ms", must be greater than or equal to 1.') end invalid_properties @@ -137,8 +137,8 @@ def rcrd_termination_silence_time_ms=(rcrd_termination_silence_time_ms) fail ArgumentError, 'invalid value for "rcrd_termination_silence_time_ms", must be smaller than or equal to 3000.' end - if !rcrd_termination_silence_time_ms.nil? && rcrd_termination_silence_time_ms <= 0 - fail ArgumentError, 'invalid value for "rcrd_termination_silence_time_ms", must be greater than 0.' + if !rcrd_termination_silence_time_ms.nil? && rcrd_termination_silence_time_ms < 1 + fail ArgumentError, 'invalid value for "rcrd_termination_silence_time_ms", must be greater than or equal to 1.' end @rcrd_termination_silence_time_ms = rcrd_termination_silence_time_ms @@ -283,7 +283,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/transcribe_webhook.rb b/lib/freeclimb/models/transcribe_webhook.rb new file mode 100644 index 00000000..e00f6c6a --- /dev/null +++ b/lib/freeclimb/models/transcribe_webhook.rb @@ -0,0 +1,481 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'date' +require 'time' + +module Freeclimb + class TranscribeWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = self.attribute_map.invert + hash = self.acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + TranscribeWebhook.new(hash) + end + # The context or reason why this request is being made. Will be transcribe - The TranscribeUtterance command has completed and its actionUrl is being invoked. + attr_accessor :request_type + + # Account ID associated with your account. + attr_accessor :account_id + + # Unique identifier for this Call, generated by FreeClimb + attr_accessor :call_id + + # Phone number of the party that initiated the Call (in E.164 format). + attr_accessor :from + + # Phone number provisioned to the customer and to which this Call is directed (in E.164 format). + attr_accessor :to + + # The ID of the recording. If no recording was made due to errors or the 'saveRecording' flag being disabled this field will be set to null. + attr_accessor :recording_id + + # The URL of the recorded audio file. This URL can be used as is in a Play command to play the recording (no authentication needed). It can also be used to download the recording file via the REST API. + attr_accessor :recording_url + + # The size of the recording in bytes. + attr_accessor :recording_size + + # The media type of the recording. + attr_accessor :recording_format + + # The duration of the recorded audio in milliseconds. + attr_accessor :recording_duration_ms + + attr_accessor :term_reason + + attr_accessor :record_term_reason + + # If recordTermReason is digit, this will be the digit that was pressed. Otherwise it will be null. + attr_accessor :digit + + # Echo back of the privacyForLogging flag as specified in the transcribe utterance command – confirmation of logging protection has been applied. Can be used by application to know it should also apply protection when handling this request. + attr_accessor :privacy_for_logging + + # Echo back of the privacyForRecording flag as specified in the transcribe utterance command – confirmation of logging protection has been applied. Can be used by application to know it should also apply protection when handling this request. + attr_accessor :privacy_for_recording + + attr_accessor :barge_in_reason + + attr_accessor :barged_in_prompt_no + + # duration in ms bargedInPromptNo prompt was executing until barge-in occurred. + attr_accessor :barged_in_prompt_ms + + attr_accessor :barged_in_prompt_loop_no + + # epoch time in ms + attr_accessor :barge_in_time_ms + + # Transcribed text of the recording. Can be empty or null. null means there was a failure in transcribing the audio, refer to transcribeReason for detailed failure reason. + attr_accessor :transcript + + attr_accessor :transcribe_reason + + # The duration of the audio being transcribed in milliseconds + attr_accessor :transcription_duration_ms + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'request_type' => :'requestType', + :'account_id' => :'accountId', + :'call_id' => :'callId', + :'from' => :'from', + :'to' => :'to', + :'recording_id' => :'recordingId', + :'recording_url' => :'recordingUrl', + :'recording_size' => :'recordingSize', + :'recording_format' => :'recordingFormat', + :'recording_duration_ms' => :'recordingDurationMs', + :'term_reason' => :'termReason', + :'record_term_reason' => :'recordTermReason', + :'digit' => :'digit', + :'privacy_for_logging' => :'privacyForLogging', + :'privacy_for_recording' => :'privacyForRecording', + :'barge_in_reason' => :'bargeInReason', + :'barged_in_prompt_no' => :'bargedInPromptNo', + :'barged_in_prompt_ms' => :'bargedInPromptMs', + :'barged_in_prompt_loop_no' => :'bargedInPromptLoopNo', + :'barge_in_time_ms' => :'bargeInTimeMs', + :'transcript' => :'transcript', + :'transcribe_reason' => :'transcribeReason', + :'transcription_duration_ms' => :'transcriptionDurationMs' + } + end + + # Returns all the JSON keys this model knows about, including the ones defined in its parent(s) + def self.acceptable_attributes + attribute_map.values.concat(superclass.acceptable_attributes) + end + + # Attribute type mapping. + def self.openapi_types + { + :'request_type' => :'String', + :'account_id' => :'String', + :'call_id' => :'String', + :'from' => :'String', + :'to' => :'String', + :'recording_id' => :'String', + :'recording_url' => :'String', + :'recording_size' => :'Integer', + :'recording_format' => :'String', + :'recording_duration_ms' => :'Integer', + :'term_reason' => :'TranscribeTermReason', + :'record_term_reason' => :'RecordUtteranceTermReason', + :'digit' => :'String', + :'privacy_for_logging' => :'Boolean', + :'privacy_for_recording' => :'Boolean', + :'barge_in_reason' => :'BargeInReason', + :'barged_in_prompt_no' => :'Integer', + :'barged_in_prompt_ms' => :'Integer', + :'barged_in_prompt_loop_no' => :'Integer', + :'barge_in_time_ms' => :'Integer', + :'transcript' => :'String', + :'transcribe_reason' => :'TranscribeReason', + :'transcription_duration_ms' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'recording_id', + :'recording_url', + :'recording_format', + :'digit', + :'transcript', + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'Webhook' + ] + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::TranscribeWebhook` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::TranscribeWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + # call parent's initialize + super(attributes) + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'call_id') + self.call_id = attributes[:'call_id'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + + if attributes.key?(:'recording_id') + self.recording_id = attributes[:'recording_id'] + end + + if attributes.key?(:'recording_url') + self.recording_url = attributes[:'recording_url'] + end + + if attributes.key?(:'recording_size') + self.recording_size = attributes[:'recording_size'] + end + + if attributes.key?(:'recording_format') + self.recording_format = attributes[:'recording_format'] + end + + if attributes.key?(:'recording_duration_ms') + self.recording_duration_ms = attributes[:'recording_duration_ms'] + end + + if attributes.key?(:'term_reason') + self.term_reason = attributes[:'term_reason'] + end + + if attributes.key?(:'record_term_reason') + self.record_term_reason = attributes[:'record_term_reason'] + end + + if attributes.key?(:'digit') + self.digit = attributes[:'digit'] + end + + if attributes.key?(:'privacy_for_logging') + self.privacy_for_logging = attributes[:'privacy_for_logging'] + end + + if attributes.key?(:'privacy_for_recording') + self.privacy_for_recording = attributes[:'privacy_for_recording'] + end + + if attributes.key?(:'barge_in_reason') + self.barge_in_reason = attributes[:'barge_in_reason'] + end + + if attributes.key?(:'barged_in_prompt_no') + self.barged_in_prompt_no = attributes[:'barged_in_prompt_no'] + end + + if attributes.key?(:'barged_in_prompt_ms') + self.barged_in_prompt_ms = attributes[:'barged_in_prompt_ms'] + end + + if attributes.key?(:'barged_in_prompt_loop_no') + self.barged_in_prompt_loop_no = attributes[:'barged_in_prompt_loop_no'] + end + + if attributes.key?(:'barge_in_time_ms') + self.barge_in_time_ms = attributes[:'barge_in_time_ms'] + end + + if attributes.key?(:'transcript') + self.transcript = attributes[:'transcript'] + end + + if attributes.key?(:'transcribe_reason') + self.transcribe_reason = attributes[:'transcribe_reason'] + end + + if attributes.key?(:'transcription_duration_ms') + self.transcription_duration_ms = attributes[:'transcription_duration_ms'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = super + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + + if @request_type.nil? + false + else + list_invalid_properties.length() == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + request_type == o.request_type && + account_id == o.account_id && + call_id == o.call_id && + from == o.from && + to == o.to && + recording_id == o.recording_id && + recording_url == o.recording_url && + recording_size == o.recording_size && + recording_format == o.recording_format && + recording_duration_ms == o.recording_duration_ms && + term_reason == o.term_reason && + record_term_reason == o.record_term_reason && + digit == o.digit && + privacy_for_logging == o.privacy_for_logging && + privacy_for_recording == o.privacy_for_recording && + barge_in_reason == o.barge_in_reason && + barged_in_prompt_no == o.barged_in_prompt_no && + barged_in_prompt_ms == o.barged_in_prompt_ms && + barged_in_prompt_loop_no == o.barged_in_prompt_loop_no && + barge_in_time_ms == o.barge_in_time_ms && + transcript == o.transcript && + transcribe_reason == o.transcribe_reason && + transcription_duration_ms == o.transcription_duration_ms && super(o) + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [request_type, account_id, call_id, from, to, recording_id, recording_url, recording_size, recording_format, recording_duration_ms, term_reason, record_term_reason, digit, privacy_for_logging, privacy_for_recording, barge_in_reason, barged_in_prompt_no, barged_in_prompt_ms, barged_in_prompt_loop_no, barge_in_time_ms, transcript, transcribe_reason, transcription_duration_ms].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + super(attributes) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = Freeclimb.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = super + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/lib/freeclimb/models/unpark.rb b/lib/freeclimb/models/unpark.rb index d44f37f8..b82bae22 100644 --- a/lib/freeclimb/models/unpark.rb +++ b/lib/freeclimb/models/unpark.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -217,7 +217,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/update_call_request.rb b/lib/freeclimb/models/update_call_request.rb index 7da2b647..80a42528 100644 --- a/lib/freeclimb/models/update_call_request.rb +++ b/lib/freeclimb/models/update_call_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -17,6 +17,28 @@ module Freeclimb class UpdateCallRequest attr_accessor :status + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -221,7 +243,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/update_call_request_status.rb b/lib/freeclimb/models/update_call_request_status.rb index dd2dc4cc..a924f66b 100644 --- a/lib/freeclimb/models/update_call_request_status.rb +++ b/lib/freeclimb/models/update_call_request_status.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/update_conference_participant_request.rb b/lib/freeclimb/models/update_conference_participant_request.rb index 83001d31..1a1d9a95 100644 --- a/lib/freeclimb/models/update_conference_participant_request.rb +++ b/lib/freeclimb/models/update_conference_participant_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -238,7 +238,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/update_conference_request.rb b/lib/freeclimb/models/update_conference_request.rb index 08702ea4..6eb7d683 100644 --- a/lib/freeclimb/models/update_conference_request.rb +++ b/lib/freeclimb/models/update_conference_request.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -22,6 +22,28 @@ class UpdateConferenceRequest attr_accessor :status + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -73,8 +95,6 @@ def initialize(attributes = {}) if attributes.key?(:'play_beep') self.play_beep = attributes[:'play_beep'] - else - self.play_beep = 'always' end if attributes.key?(:'status') @@ -239,7 +259,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/models/update_conference_request_status.rb b/lib/freeclimb/models/update_conference_request_status.rb index 7bf4975b..e579e212 100644 --- a/lib/freeclimb/models/update_conference_request_status.rb +++ b/lib/freeclimb/models/update_conference_request_status.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/lib/freeclimb/models/call_list_all_of.rb b/lib/freeclimb/models/webhook.rb similarity index 90% rename from lib/freeclimb/models/call_list_all_of.rb rename to lib/freeclimb/models/webhook.rb index 0b5d1cfe..426ea148 100644 --- a/lib/freeclimb/models/call_list_all_of.rb +++ b/lib/freeclimb/models/webhook.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -14,13 +14,14 @@ require 'time' module Freeclimb - class CallListAllOf - attr_accessor :calls + class Webhook + # Type of webhook request + attr_accessor :request_type # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'calls' => :'calls' + :'request_type' => :'requestType' } end @@ -32,36 +33,38 @@ def self.acceptable_attributes # Attribute type mapping. def self.openapi_types { - :'calls' => :'Array' + :'request_type' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ - :'calls' ]) end + # discriminator's property name in OpenAPI v3 + def self.openapi_discriminator_name + :'request_type' + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::CallListAllOf` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::Webhook` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::CallListAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::Webhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } - if attributes.key?(:'calls') - if (value = attributes[:'calls']).is_a?(Array) - self.calls = value - end + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] end end @@ -76,7 +79,7 @@ def list_invalid_properties # @return true if the model is valid def valid? - if @calls.nil? + if @request_type.nil? false else list_invalid_properties.length() == 0 @@ -88,7 +91,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - calls == o.calls + request_type == o.request_type end # @see the `==` method @@ -100,7 +103,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [calls].hash + [request_type].hash end # Builds the object from hash @@ -220,7 +223,5 @@ def _to_hash(value) value end end - end - end diff --git a/lib/freeclimb/utils/request_verifier.rb b/lib/freeclimb/utils/request_verifier.rb index 61a6a9ea..994b2e71 100644 --- a/lib/freeclimb/utils/request_verifier.rb +++ b/lib/freeclimb/utils/request_verifier.rb @@ -1,61 +1,61 @@ module Freeclimb - class RequestVerifier - class << self - @@DEFAULT_TOLERANCE = 5 * 60 * 1000 - - def verify_request_signature(request_body, request_header, signing_secret, tolerance=DEFAULT_TOLERANCE) - request_verifier_object = Freeclimb::RequestVerifier.new() - request_verifier_object.instance_eval{ check_request_body(request_body) } - request_verifier_object.instance_eval{ check_request_header(request_header) } - request_verifier_object.instance_eval{ check_signing_secret(signing_secret) } - request_verifier_object.instance_eval{ check_tolerance(tolerance) } - info = Freeclimb::SignatureInformation.new(request_header) - request_verifier_object.instance_eval{ verify_tolerance(info, tolerance) } - request_verifier_object.instance_eval{ verify_signature(info, request_body, signing_secret)} - end - end + class RequestVerifier + class << self + @@DEFAULT_TOLERANCE = 5 * 60 * 1000 + + def verify_request_signature(request_body, request_header, signing_secret, tolerance = DEFAULT_TOLERANCE) + request_verifier_object = Freeclimb::RequestVerifier.new() + request_verifier_object.instance_eval { check_request_body(request_body) } + request_verifier_object.instance_eval { check_request_header(request_header) } + request_verifier_object.instance_eval { check_signing_secret(signing_secret) } + request_verifier_object.instance_eval { check_tolerance(tolerance) } + info = Freeclimb::SignatureInformation.new(request_header) + request_verifier_object.instance_eval { verify_tolerance(info, tolerance) } + request_verifier_object.instance_eval { verify_signature(info, request_body, signing_secret) } + end + end - private + private - def check_request_body(request_body) - if request_body == "" || request_body == nil - raise 'Request Body cannot be empty or null' - end - end + def check_request_body(request_body) + if request_body == "" || request_body == nil + raise 'Request Body cannot be empty or null' + end + end - def check_request_header(request_header) - if request_header == "" || request_header == nil - raise 'Error with request header, Request header is empty' - elsif !(request_header.include? "t") - raise 'Error with request header, timestamp is not present' - elsif !(request_header.include? "v1") - raise 'Error with request header, signatures are not present' - end - end + def check_request_header(request_header) + if request_header == "" || request_header == nil + raise 'Error with request header, Request header is empty' + elsif !(request_header.include? "t") + raise 'Error with request header, timestamp is not present' + elsif !(request_header.include? "v1") + raise 'Error with request header, signatures are not present' + end + end - def check_signing_secret(signing_secret) - if signing_secret == "" || signing_secret == nil - raise 'Signing secret cannot be empty or null' - end - end + def check_signing_secret(signing_secret) + if signing_secret == "" || signing_secret == nil + raise 'Signing secret cannot be empty or null' + end + end - def check_tolerance(tolerance) - if tolerance <= 0 || !(tolerance.is_a? Integer) - raise 'Tolerance value must be a positive integer' - end - end + def check_tolerance(tolerance) + if tolerance <= 0 || !(tolerance.is_a? Integer) + raise 'Tolerance value must be a positive integer' + end + end - def verify_tolerance(info, tolerance) - currentTime = info.get_current_unix_time() - if !info.is_request_time_valid(tolerance) - raise "Request time exceeded tolerance threshold. Request: " + info.request_timestamp.to_s + ", CurrentTime: " + currentTime.to_s + ", tolerance: " + tolerance.to_s - end - end + def verify_tolerance(info, tolerance) + currentTime = info.get_current_unix_time() + if !info.is_request_time_valid(tolerance) + raise "Request time exceeded tolerance threshold. Request: " + info.request_timestamp.to_s + ", CurrentTime: " + currentTime.to_s + ", tolerance: " + tolerance.to_s + end + end - def verify_signature(info, request_body, signing_secret) - if !info.is_signature_safe(request_body, signing_secret) - raise "Unverified signature request, If this request was unexpected, it may be from a bad actor. Please proceed with caution. If the request was exepected, please check any typos or issues with the signingSecret" - end - end + def verify_signature(info, request_body, signing_secret) + if !info.is_signature_safe(request_body, signing_secret) + raise "Unverified signature request, If this request was unexpected, it may be from a bad actor. Please proceed with caution. If the request was exepected, please check any typos or issues with the signingSecret" + end end + end end \ No newline at end of file diff --git a/lib/freeclimb/utils/signature_information.rb b/lib/freeclimb/utils/signature_information.rb index 6180d94c..02b5e933 100644 --- a/lib/freeclimb/utils/signature_information.rb +++ b/lib/freeclimb/utils/signature_information.rb @@ -2,44 +2,44 @@ require 'openssl' module Freeclimb - class SignatureInformation - attr_accessor :request_timestamp - attr_accessor :signatures + class SignatureInformation + attr_accessor :request_timestamp + attr_accessor :signatures - def initialize(request_header) - @request_timestamp = 0 - @signatures = [] - signatureHeader = request_header.try(:split, ",") - signatureHeader.each { |signature| - header, value = signature.try(:split, "=") - if header == "t" - @request_timestamp = value.to_i - elsif header == "v1" - @signatures.append(value) - end - } - end - - def is_request_time_valid(tolerance) - currentTime = self.get_current_unix_time() - timeCalculation = @request_timestamp + tolerance - return currentTime < (timeCalculation) - end + def initialize(request_header) + @request_timestamp = 0 + @signatures = [] + signatureHeader = request_header.try(:split, ",") + signatureHeader.each { |signature| + header, value = signature.try(:split, "=") + if header == "t" + @request_timestamp = value.to_i + elsif header == "v1" + @signatures.append(value) + end + } + end - def is_signature_safe(request_body, signing_secret) - hashValue = self.compute_hash(request_body, signing_secret) - return @signatures.include? hashValue - end + def is_request_time_valid(tolerance) + currentTime = self.get_current_unix_time() + timeCalculation = @request_timestamp + tolerance + currentTime < (timeCalculation) + end - def compute_hash(request_body, signing_secret) - data = @request_timestamp.to_s + "." + request_body - return OpenSSL::HMAC.hexdigest('sha256', signing_secret, data) - end + def is_signature_safe(request_body, signing_secret) + hashValue = self.compute_hash(request_body, signing_secret) + @signatures.include? hashValue + end - def get_current_unix_time() - return DateTime.now.strftime('%s').to_i - end + def compute_hash(request_body, signing_secret) + data = @request_timestamp.to_s + "." + request_body + OpenSSL::HMAC.hexdigest('sha256', signing_secret, data) + end - private :compute_hash + def get_current_unix_time + DateTime.now.strftime('%s').to_i end + + private :compute_hash + end end \ No newline at end of file diff --git a/lib/freeclimb/version.rb b/lib/freeclimb/version.rb index 6f88f389..739fa798 100644 --- a/lib/freeclimb/version.rb +++ b/lib/freeclimb/version.rb @@ -6,10 +6,10 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end module Freeclimb - VERSION = '4.9.0' + VERSION = '5.0.0' end diff --git a/openapi.json b/openapi.json index 554dc8cb..16e35209 100644 --- a/openapi.json +++ b/openapi.json @@ -22,7 +22,6 @@ "in": "path", "description": "ID of the account", "required": true, - "x-account-id": true, "schema": { "type": "string" } @@ -84,8 +83,6 @@ "AccountStatus": { "type": "string", "enum": ["closed", "suspended", "active"], - "x-enum-varnames": ["CLOSED", "SUSPENDED", "ACTIVE"], - "x-enum": true, "description": "The status of this account. It is one of: active, suspended, or closed.", "nullable": true }, @@ -93,24 +90,18 @@ "type": "string", "description": "The type of this account. It is one of: trial or full.", "enum": ["trial", "full"], - "x-enum": true, - "x-enum-varnames": ["TRIAL", "FULL"], "nullable": true }, "AnsweredBy": { "type": "string", "nullable": true, "enum": ["human", "machine"], - "x-enum-varnames": ["HUMAN", "MACHINE"], - "x-enum": true, "description": "If this Call was initiated with answering machine detection, either `human` or `machine`. Empty otherwise." }, "CallDirection": { "type": "string", "nullable": true, "enum": ["inbound", "outboundAPI", "outboundDial"], - "x-enum-varnames": ["INBOUND", "OUTBOUND_API", "OUTBOUND_DIAL"], - "x-enum": true, "description": "Direction of the Call. `inbound` for Calls into FreeClimb, `outboundAPI` for Calls initiated via the REST API, `outboundDial` for Calls initiated by the `OutDial` PerCL command." }, "CallStatus": { @@ -126,25 +117,52 @@ "busy", "noAnswer" ], - "x-enum-varnames": [ - "QUEUED", - "RINGING", - "IN_PROGRESS", - "CANCELED", - "COMPLETED", - "FAILED", - "BUSY", - "NO_ANSWER" - ], - "x-enum": true, "description": "* `queued` – Call is ready and waiting in line before going out. * `ringing` – Call is currently ringing. * `inProgress` – Call was answered and is currently in progress. * `canceled` – Call was hung up while it was queued or ringing. * `completed` – Call was answered and has ended normally. * `busy` – Caller received a busy signal. * `failed` – Call could not be completed as dialed, most likely because the phone number was non-existent. * `noAnswer` – Call ended without being answered." }, + "CallEndedReason": { + "type": "string", + "nullable": true, + "enum": [ + "busy", + "failed", + "noAnswer", + "callCanceled", + "farEndHangup", + "appHangup", + "appReject", + "appNoPercl", + "appInvalidPercl", + "conferenceTerminated", + "conferenceEmptied", + "removedFromConference", + "machineDetected", + "webhookFailed", + "webhookInvalidResponse", + "voiceDisabled", + "configErrorNoApplication", + "configErrorNoVoiceUrl", + "maxRedirectsError", + "perclProcessingError", + "internalError", + "grpcHangup", + "maxDuration" + ], + "description": "Enhanced status for the Call with additional information where available." + }, + "GetDigitsReason": { + "type": "string", + "enum": [ + "finishKey", + "timeout", + "maxDigits", + "tone" + ], + "description": "This field explains how the GetDigits action ended. The value is one of the below: •finishKey - The finish key as specified had been pressed by the caller. Digit string has all keys up to, but not including, the finish key. •timeout - The timeout limit was reached prior to any other criteria being met. If any digits were collected, they will be included. •maxDigits - The maximum number of digits was reached and digit collection ended. •tone - Answering machine or fax tone detection occurred, interrupting digit collection. Any digits received up to this point are included in this webhook." + }, "ConferenceStatus": { "type": "string", "nullable": true, "enum": ["empty", "populated", "inProgress", "terminated"], - "x-enum-varnames": ["EMPTY", "POPULATED", "IN_PROGRESS", "TERMINATED"], - "x-enum": true, "description": "The status of the Conference. One of: creating, empty, populated, inProgress, or terminated." }, "GetSpeechReason": { @@ -156,16 +174,7 @@ "noInput", "noMatch", "recognition" - ], - "x-enum-varnames": [ - "ERROR", - "HANGUP", - "DIGIT", - "NO_INPUT", - "NO_MATCH", - "RECOGNITION" - ], - "x-enum": true + ] }, "GrammarFileBuiltIn": { "type": "string", @@ -185,39 +194,17 @@ "DIG11", "UP_TO_20_DIGIT_SEQUENCE", "VERSAY_YESNO" - ], - "x-enum-varnames": [ - "ALPHNUM6", - "ANY_DIG", - "DIG1", - "DIG2", - "DIG3", - "DIG4", - "DIG5", - "DIG6", - "DIG7", - "DIG8", - "DIG9", - "DIG10", - "DIG11", - "UP_TO_20_DIGIT_SEQUENCE", - "VERSAY_YESNO" - ], - "x-enum": true + ] }, "GrammarType": { "type": "string", "enum": ["URL", "BUILTIN"], "nullable": true, - "x-enum-varnames": ["URL", "BUILT_IN"], - "x-enum": true, "description": "The grammar file type to use for speech recognition. A value of 'URL' indicates the grammarFile attribute specifies a URL that points to the grammar file. A value of `BUILTIN` indicates the grammarFile attribute specifies the name of one of the platform built-in grammar files." }, "IfMachine": { "type": "string", "enum": ["redirect", "hangup"], - "x-enum-varnames": ["REDIRECT", "HANGUP"], - "x-enum": true, "description": "Specifies how FreeClimb should handle this OutDial if an answering machine answers the Call. Valid values: `redirect` invokes the ifMachineUrl for instructions. `hangup` hangs up the Call. The ifMachineUrl will not be invoked." }, "Language": { @@ -249,56 +236,21 @@ "zh-CN", "zh-HK", "zh-TW" - ], - "x-enum-varnames": [ - "CATALAN", - "DANISH", - "GERMAN", - "ENGLISH_AU", - "ENGLISH_CA", - "ENGLISH_UK", - "ENGLISH_IN", - "ENGLISH_US", - "ENGLISH_ES", - "ENGLISH_MX", - "FINNISH", - "FRENCH_CA", - "FRENCH_FR", - "ITALIAN", - "JAPANESE", - "KOREAN", - "NORWEGIAN", - "DUTCH", - "POLISH", - "PORTUGESE_BR", - "PORTUGESE_PT", - "RUSSIAN", - "SWEDISH", - "CHINESE_CN", - "CHINESE_HK", - "CHINESE_TW" - ], - "x-enum": true + ] }, "LogLevel": { "type": "string", "enum": ["info", "warning", "error"], "nullable": true, - "x-enum-varnames": ["INFO", "WARNING", "ERROR"], - "x-enum": true, "description": "Level of the log. Possible values are info, warning, and error." }, "MachineType": { "type": "string", - "enum": ["answeringMachine", "faxMachine"], - "x-enum-varnames": ["ANSWERING_MACHINE", "FAX_MACHINE"], - "x-enum": true + "enum": ["answering machine", "fax modem"] }, "MessageDirection": { "type": "string", - "enum": ["inbound", "outbound"], - "x-enum-varnames": ["INBOUND", "OUTBOUND"], - "x-enum": true + "enum": ["inbound", "outbound"] }, "MessageStatus": { "type": "string", @@ -316,43 +268,33 @@ "expired", "deleted", "unknown" - ], - "x-enum-varnames": [ - "NEW", - "QUEUED", - "REJECTED", - "SENDING", - "SENT", - "FAILED", - "RECEIVED", - "UNDELIVERED", - "EXPIRED", - "DELETED", - "UNKNOWN" - ], - "x-enum": true + ] }, "PlayBeep": { "type": "string", "nullable": true, "enum": ["always", "never", "entryOnly", "exitOnly"], - "x-enum-varnames": ["ALWAYS", "NEVER", "ENTRY_ONLY", "EXIT_ONLY"], - "x-enum": true, - "description": "Indicates whether to play a beep when a Participant enters or leaves the Conference. either `always`, `never`, `entryOnly`, or `exitOnly`. Leaving this unset will make conference default to `always` ", - "default": "always", - "x-enum-default-attr": "ALWAYS" + "description": "Indicates whether to play a beep when a Participant enters or leaves the Conference. either `always`, `never`, `entryOnly`, or `exitOnly`. Leaving this unset will make conference default to `always` " }, "QueueResultStatus": { "type": "string", - "enum": ["queueFull", "dequeued", "hangup", "systemError"], - "x-enum-varnames": ["QUEUE_FULL", "DEQUEUED", "HANGUP", "SYSTEM_ERROR"], - "x-enum": true + "enum": ["queueFull", "dequeued", "hangup", "systemError"] }, "RecordUtteranceTermReason": { "type": "string", - "enum": ["finishKey", "timeout", "hangup", "maxLength"], - "x-enum-varnames": ["FINISH_KEY", "TIMEOUT", "HANGUP", "MAX_LENGTH"], - "x-enum": true + "enum": ["finishKey", "timeout", "hangup", "maxLength"] + }, + "BargeInReason": { + "type": "string", + "enum": ["noBargeIn", "bargeInByDTMF", "bargeInByEnergy"] + }, + "TranscribeTermReason": { + "type": "string", + "enum": ["error", "completed"] + }, + "TranscribeReason": { + "type": "string", + "enum": ["internalError", "hangup", "maxLength", "digit", "noInput"] }, "RequestType": { "type": "string", @@ -380,120 +322,1590 @@ "conferenceCallControl", "messageDelivery", "messageStatus" - ], - "x-enum-varnames": [ - "INBOUND_CALL", - "RECORD", - "GET_DIGITS", - "GET_SPEECH", - "REDIRECT", - "PAUSE", - "OUT_DIAL_START", - "OUT_DIAL_CONNECT", - "OUT_DIAL_API_CONNECT", - "MACHINE_DETECTED", - "DEQUEUE", - "QUEUE_WAIT", - "ADD_TO_QUEUE_NOTIFICATION", - "REMOVE_FROM_QUEUE_NOTIFICATION", - "CALL_STATUS", - "CREATE_CONFERENCE", - "CONFERENCE_STATUS", - "LEAVE_CONFERENCE", - "ADD_TO_CONFERENCE_NOTIFICATION", - "CONFERENCE_RECORDING_STATUS", - "CONFERENCE_CALL_CONTROL", - "MESSAGE_DELIVERY", - "MESSAGE_STATUS" - ], - "x-enum": true + ] }, "UpdateCallRequestStatus": { "type": "string", "enum": ["canceled", "completed"], - "x-enum-varnames": ["CANCELED", "COMPLETED"], - "x-enum": true, "description": "Either `canceled` or `completed`. Specifying `canceled` attempts to hang up calls that are queued without affecting calls already in progress. Specifying `completed` attempts to hang up a call already in progress." }, "UpdateConferenceRequestStatus": { "type": "string", "enum": ["empty", "terminated"], - "x-enum-varnames": ["EMPTY", "TERMINATED"], - "x-enum": true, "description": "New status of the conference. Valid values: `empty` or `terminated`. For more information, see **Status Parameter** below.**" }, + "SMSTollFreeCampaignRegistrationStatus": { + "type": "string", + "description": "Current toll-free campaign registration status.Possible values: UNREGISTERED,INITIATED,PENDING,DECLINED,REGISTERED. A newly created campaign defaults to INITIATED status. ", + "enum": [ + "UNREGISTERED", + "INITIATED", + "PENDING", + "DECLINED", + "REGISTERED" + ] + }, + "SMSTenDLCCampaignStatus": { + "type": "string", + "description": "Current campaign status. Possible values: ACTIVE, EXPIRED. A newly created campaign defaults to ACTIVE status. ", + "enum": ["ACTIVE", "EXPIRED"] + }, + "SMSTenDLCPartnerCampaignStatus": { + "type": "string", + "description": "Current campaign status. Possible values: ACTIVE, EXPIRED. A newly created campaign defaults to ACTIVE status. ", + "enum": ["ACTIVE", "EXPIRED"] + }, + "SMSTenDLCBrandEntityType": { + "maxLength": 20, + "type": "string", + "description": "Entity type behind the brand. This is the form of business establishment.", + "enum": [ + "PRIVATE_PROFIT", + "PUBLIC_PROFIT", + "NON_PROFIT", + "GOVERNMENT", + "SOLE_PROPRIETOR" + ] + }, + "SMSTenDLCBrandRelationship": { + "type": "string", + "description": "Brand relationship to the CSP", + "enum": [ + "BASIC_ACCOUNT", + "SMALL_ACCOUNT", + "MEDIUM_ACCOUNT", + "LARGE_ACCOUNT", + "KEY_ACCOUNT" + ] + }, + "SMSTenDLCBrandStockExchange": { + "type": "string", + "description": "(Required for public company) stock exchange.", + "example": "NASDAQ", + "enum": [ + "NONE", + "NASDAQ", + "NYSE", + "AMEX", + "AMX", + "ASX", + "B3", + "BME", + "BSE", + "FRA", + "ICEX", + "JPX", + "JSE", + "KRX", + "LON", + "NSE", + "OMX", + "SEHK", + "SGX", + "SSE", + "STO", + "SWX", + "SZSE", + "TSX", + "TWSE", + "VSE", + "OTHER" + ] + }, + "SMSTenDLCBrandAltBusinessIdType": { + "type": "string", + "enum": ["NONE", "DUNS", "GIIN", "LEI"], + "description": "The type of the Alternative business identifier" + }, + "SMSTenDLCBrandIdentityStatus": { + "type": "string", + "description": "TCR assessment of the brand identification status.", + "enum": [ + "SELF_DECLARED", + "UNVERIFIED", + "VERIFIED", + "VETTED_VERIFIED" + ] + }, + "CompletionResultStatus": { + "type": "string", + "description": "Completion result status. Possible values: success, no_context", + "enum": ["success", "no_context"] + }, + "SMSTenDLCOptionalAttributes": { + "type": "object", + "description": "Optional brand attributes. Please refer to GET /enum/optionalAttributeNames for dictionary of optional attribute names.", + "additionalProperties": true + }, "PerclScript": { "type": "object", "description": "A PerCL script to be returned to the FreeClimb servers in FreeClimb applications", - "x-percl-script": true, "properties": { "commands": { "type": "array", "description": "A JSON array of PerCL commands", - "x-is-list": true, "items": { "$ref": "#/components/schemas/PerclCommand" } } - } + } + }, + "PerclCommand": { + "type": "object", + "description": "An individual command used in a PerCLScript.", + "discriminator": { + "propertyName": "command", + "mapping": { + "AddToConference": "#/components/schemas/AddToConference", + "CreateConference": "#/components/schemas/CreateConference", + "Dequeue": "#/components/schemas/Dequeue", + "Enqueue": "#/components/schemas/Enqueue", + "GetDigits": "#/components/schemas/GetDigits", + "GetSpeech": "#/components/schemas/GetSpeech", + "Hangup": "#/components/schemas/Hangup", + "OutDial": "#/components/schemas/OutDial", + "Pause": "#/components/schemas/Pause", + "Park": "#/components/schemas/Park", + "Play": "#/components/schemas/Play", + "PlayEarlyMedia": "#/components/schemas/PlayEarlyMedia", + "RecordUtterance": "#/components/schemas/RecordUtterance", + "Redirect": "#/components/schemas/Redirect", + "Reject": "#/components/schemas/Reject", + "RemoveFromConference": "#/components/schemas/RemoveFromConference", + "Say": "#/components/schemas/Say", + "SendDigits": "#/components/schemas/SendDigits", + "SetListen": "#/components/schemas/SetListen", + "SetTalk": "#/components/schemas/SetTalk", + "SetDTMFPassThrough": "#/components/schemas/SetDTMFPassThrough", + "Sms": "#/components/schemas/Sms", + "StartRecordCall": "#/components/schemas/StartRecordCall", + "TerminateConference": "#/components/schemas/TerminateConference", + "TranscribeUtterance": "#/components/schemas/TranscribeUtterance", + "Unpark": "#/components/schemas/Unpark" + } + }, + "properties": { + "command": { + "type": "string", + "description": "Name of PerCL Command (this is automatically derived from mapping configuration and should not be manually supplied in any arguments)" + } + } + }, + "Webhook": { + "type": "object", + "discriminator": { + "propertyName": "requestType", + "mapping": { + "addToConferenceNotification": "#/components/schemas/AddToConferenceNotificationWebhook", + "addToQueueNotification": "#/components/schemas/AddToQueueNotificationWebhook", + "callControl": "#/components/schemas/CallControlWebhook", + "callStatus": "#/components/schemas/CallStatusWebhook", + "conferenceRecordingStatus": "#/components/schemas/ConferenceRecordingStatusWebhook", + "conferenceStatus": "#/components/schemas/ConferenceStatusWebhook", + "createConference": "#/components/schemas/CreateConferenceWebhook", + "dequeue": "#/components/schemas/DequeueWebhook", + "getDigits": "#/components/schemas/GetDigitsWebhook", + "getSpeech": "#/components/schemas/GetSpeechWebhook", + "inboundCall": "#/components/schemas/InboundCallWebhook", + "leaveConference": "#/components/schemas/LeaveConferenceWebhook", + "machineDetected": "#/components/schemas/MachineDetectedWebhook", + "messageDelivery": "#/components/schemas/MessageDeliveryWebhook", + "messageStatus": "#/components/schemas/MessageStatusWebhook", + "outDialApiConnect": "#/components/schemas/OutDialApiConnectWebhook", + "outDialConnect": "#/components/schemas/OutDialConnectWebhook", + "outDialStart": "#/components/schemas/OutDialStartWebhook", + "queueWait": "#/components/schemas/QueueWaitWebhook", + "record": "#/components/schemas/RecordWebhook", + "redirect": "#/components/schemas/RedirectWebhook", + "removeFromQueueNotification": "#/components/schemas/RemoveFromQueueNotificationWebhook", + "transcribe": "#/components/schemas/TranscribeWebhook" + } + }, + "properties": { + "requestType": { + "type": "string", + "description": "Type of webhook request" + } + } + }, + "AddToConferenceNotificationWebhook": { + "description": "A Call has been bridged to a Conference and the AddToConference command’s notificationUrl is being invoked. This is a notification only; any PerCL returned will be ignored.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be addToConferenceNotification - A Call has been bridged to a conference and the addToConference command’s notificationUrl is being invoked." + }, + "callId": { + "type": "string", + "description": "Unique ID for this Call, generated by FreeClimb." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to you and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "Unique ID of the Conference." + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a Queue. Otherwise, it is set to null.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/ConferenceStatus" + }, + "recordingUrl": { + "type": "string", + "description": "URL of the Conference’s recorded audio. Populated only if a Recording exists and the Conference was emptied.", + "format": "uri" + }, + "recordingId": { + "type": "string", + "description": "Unique ID of the Recording from this Conference. Populated only if a recording exists and the Conference was emptied." + }, + "recordingDurationSec": { + "type": "integer", + "description": "Duration of the recorded audio (in seconds), rounded up to the nearest second. Populated only if a Recording exists and the Conference was emptied." + } + } + } + ] + }, + "AddToQueueNotificationWebhook": { + "description": "A Call has been added to a Queue and the Enqueue command’s notificationUrl is being invoked. This is a notification only; any PerCL returned will be ignored.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be addToQueueNotification - A call has been added to a queue and the Enqueue command’s notificationUrl is being invoked." + }, + "callId": { + "type": "string", + "description": "Unique ID for this Call, generated by FreeClimb." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to you and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "Unique ID of the Conference." + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a Queue. Otherwise, it is set to null.", + "nullable": true + } + } + } + ] + }, + "CallControlWebhook": { + "description": "The digit sequence defined in the callControlSequence attribute of the AddToConference PerCL command has been entered by the Conference participant. A PerCL response is expected. If invalid PerCL is provided, the call leg which triggered this webhook will terminate.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be callControl." + }, + "callId": { + "type": "string", + "description": "Unique ID for this Call, generated by FreeClimb." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "conferenceId": { + "type": "string", + "description": "Unique ID of the Conference." + }, + "digits": { + "type": "string", + "description": "String of digits entered by the participant." + } + } + } + ] + }, + "CallStatusWebhook": { + "description": "A Call has ended and the statusCallbackUrl is being invoked. This is a notification only; All PerCL commands will be ignored.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be callStatus - A Call has ended and the statusCallbackUrl is being invoked." + }, + "callId": { + "type": "string", + "description": "Unique ID for this Call, generated by FreeClimb." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to you and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "callEndedReason": { + "$ref": "#/components/schemas/CallEndedReason" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "Unique ID of the Conference." + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a Queue. Otherwise, it is set to null.", + "nullable": true + } + } + } + ] + }, + "ConferenceRecordingStatusWebhook": { + "description": "The statusCallbackUrl request includes Recording information for a Conference that ended. This is a notification only; any PerCL returned will be ignored.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be conferenceRecordingStatus - The statusCallbackUrl request includes Recording information for a Conference that ended." + }, + "callId": { + "type": "string", + "description": "Unique ID for this Call, generated by FreeClimb." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to you and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "Unique ID of the Conference." + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a Queue. Otherwise, it is set to null.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/ConferenceStatus" + }, + "recordingUrl": { + "type": "string", + "description": "URL of the Conference’s recorded audio. Populated only if a Recording exists and the Conference was emptied.", + "format": "uri" + }, + "recordingId": { + "type": "string", + "description": "Unique ID of the Recording from this Conference. Populated only if a recording exists and the Conference was emptied." + }, + "recordingDurationSec": { + "type": "integer", + "description": "Duration of the recorded audio (in seconds), rounded up to the nearest second. Populated only if a Recording exists and the Conference was emptied." + } + } + } + ] + }, + "ConferenceStatusWebhook": { + "description": "The context or reason why this request is being made. Will be conferenceStatus - A Conference's status changed and its statusCallbackUrl is being invoked.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be conferenceRecordingStatus - The statusCallbackUrl request includes Recording information for a Conference that ended." + }, + "callId": { + "type": "string", + "description": "Unique ID for this Call, generated by FreeClimb." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to you and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "Unique ID of the Conference." + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a Queue. Otherwise, it is set to null.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/ConferenceStatus" + }, + "recordingUrl": { + "type": "string", + "description": "The URL of the Conference’s recorded audio. Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked.", + "format": "uri", + "nullable": true + }, + "recordingId": { + "type": "string", + "description": "The unique ID of the Recording from this Conference. Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked.", + "nullable": true + }, + "recordingDurationSec": { + "type": "integer", + "description": "The duration of the recorded audio rounded up to the nearest second (in seconds). Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked.", + "nullable": true + } + } + } + ] + }, + "CreateConferenceWebhook": { + "description": "A Conference has been created and its statusCallbackUrl or actionUrl is being invoked. A PerCL response is expected if the actionUrl is being invoked.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be createConference - A Conference has been created and its statusCallbackUrl or actionUrl is being invoked." + }, + "callId": { + "type": "string", + "description": "Unique ID for this Call, generated by FreeClimb." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to you and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "Unique ID of the Conference." + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a Queue. Otherwise, it is set to null.", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/ConferenceStatus" + }, + "recordingUrl": { + "type": "string", + "description": "The URL of the Conference’s recorded audio. Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked.", + "format": "uri", + "nullable": true + }, + "recordingId": { + "type": "string", + "description": "The unique ID of the Recording from this Conference. Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked.", + "nullable": true + }, + "recordingDurationSec": { + "type": "integer", + "description": "The duration of the recorded audio rounded up to the nearest second (in seconds). Populated only if a Recording exists and the Conference was emptied. Present only if statusCallbackUrl is being invoked.", + "nullable": true + } + } + } + ] + }, + "DequeueWebhook": { + "description": "A queued call has been dequeued and the actionUrl of the corresponding Enqueue action is being invoked. A PerCL response is expected.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be dequeue - A queued call has been dequeued and the actionUrl of the corresponding Enqueue action is being invoked." + }, + "callId": { + "type": "string", + "description": "Unique ID for this Call, generated by FreeClimb." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to you and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "Unique ID of the Conference." + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a Queue. Otherwise, it is set to null.", + "nullable": true + }, + "queueResult": { + "type": "string", + "description": "The final result of the enqueued Call. Valid values are: •dequeued - Enqueued caller exited the Queue via a Dequeue action (Dequeue command or Queue Members POST REST API)." + }, + "queueTime": { + "type": "integer", + "description": "Time (in seconds) the call spent in the Queue. This is only available if the Call was actually enqueued.", + "nullable": true + } + } + } + ] + }, + "GetDigitsWebhook": { + "description": "A POST request with the following fields will be sent to the actionUrl provided in your GetDigits command.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be getDigits - The GetDigits command has completed and its actionUrl is being invoked." + }, + "callId": { + "type": "string", + "description": "Unique ID for this Call, generated by FreeClimb." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to you and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "Unique ID of the Conference." + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a Queue. Otherwise, it is set to null.", + "nullable": true + }, + "digits": { + "type": "string", + "description": "tring of digits entered by the Caller, excluding the terminating digit (if used). The string of digits will be replaced by 'xxxxx' when privacyMode is set to true" + }, + "reason": { + "$ref": "#/components/schemas/GetDigitsReason" + }, + "parentCallId": { + "type": "string", + "description": "ID of the Call that created this leg (child call)." + } + } + } + ] + }, + "GetSpeechWebhook": { + "description": "The GetSpeech command has completed and its actionUrl is being invoked. A PerCL response is expected, unless reason is hangup.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be getSpeech - The GetSpeech command has completed and its actionUrl is being invoked." + }, + "callId": { + "type": "string", + "description": "Unique ID for this Call, generated by FreeClimb." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to you and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "Unique ID of the Conference." + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a Queue. Otherwise, it is set to null.", + "nullable": true + }, + "reason": { + "$ref": "#/components/schemas/GetSpeechReason" + }, + "recognitionResult": { + "type": "string", + "description": "Semantic content (either a string if speech was recognized or a digit if a digit was input instead of speech) returned from the entry or tag that was recognized within the grammar. The content will be replaced by 'xxxxx' when privacyMode is set to true. This field is populated only if the reason field is set to recognition or digit." + }, + "confidence": { + "type": "integer", + "description": "Level of confidence in the obtained result. This is a value in the range 0 to 100 – with 0 being total lack of confidence and 100 being absolute certainty in the recognition. This field is populated only if the reason field is set to recognition." + }, + "parentCallId": { + "type": "string", + "description": "ID of the Call that created this leg (child call)." + }, + "completionReason": { + "type": "string", + "description": "Advanced diagnostic information if reason was error. See RFC 6787 section 9.4.12 - speech recognition." + }, + "completionCause": { + "type": "string", + "description": "Advanced diagnostic information if reason was error. See RFC 6787 section 9.4.11 - speech recognition." + }, + "mrcpCode": { + "type": "integer", + "description": "Advanced diagnostic information if reason was error. See RFC 6787 section 5.4 - MRCPv2 specification." + }, + "mrcpDiagnostic": { + "type": "string", + "description": "Advanced diagnostic information if reason was error. See RFC 6787 section 5.4 - MRCPv2 specification." + } + } + } + ] + }, + "InboundCallWebhook": { + "description": "An inbound Call to a number registered on FreeClimb will trigger a request to the voiceUrl of the application the number is assigned to. FreeClimb expects to receive PerCL in response to this request in order to process the Call. The following parameters are sent as the POST body.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be inboundCall - An inbound call was received and the voiceUrl is being invoked." + }, + "callId": { + "type": "string", + "description": "Unique ID for this Call, generated by FreeClimb." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to you and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "This is only populated if request pertains to a Conference. Otherwise, it is set to null.", + "nullable": true + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a Queue. Otherwise, it is set to null.", + "nullable": true + }, + "parentCallId": { + "type": "string", + "nullable": true + } + } + } + ] + }, + "LeaveConferenceWebhook": { + "description": "A Call has been unbridged from a Conference and its leaveConferenceUrl is being invoked. A PerCL response is expected — unless the URL is invoked due to the participant hanging up.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be leaveConference - Call has been unbridged from a Conference and its leaveConferenceUrl is being invoked." + }, + "callId": { + "type": "string", + "description": "Unique ID for this Call, generated by FreeClimb. This is the call leg which has left the Conference" + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to you and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "This is only populated if request pertains to a Conference. Otherwise, it is set to null.", + "nullable": true + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a Queue. Otherwise, it is set to null.", + "nullable": true + } + } + } + ] + }, + "MachineDetectedWebhook": { + "description": "An outbound call spawned by OutDial detected an answer by a machine (answering machine or fax/modem machine) and ifMachineUrl is being invoked. A PerCL response is expected.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be machineDetected - An outbound call spawned by OutDial was answered by a machine and the ifMachineUrl is being invoked." + }, + "callId": { + "type": "string", + "description": "Unique ID for this Call, generated by FreeClimb." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to you and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "This is only populated if request pertains to a Conference. Otherwise, it is set to null.", + "nullable": true + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a Queue. Otherwise, it is set to null.", + "nullable": true + }, + "parentCallId": { + "type": "string", + "description": "Call ID of the leg which initiated the OutDial." + }, + "machineType": { + "$ref": "#/components/schemas/MachineType" + } + } + } + ] + }, + "MessageDeliveryWebhook": { + "description": "An SMS has been received by the platform and is being delivered to the smsUrl of the customer application that is associated with the destination number. A PerCL response will be ignored.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Value will be messageDelivery - An SMS message has been received by the platform and is being delivered to the customer application associated with the destination number." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to you and to which this Call is directed (in E.164 format)." + }, + "text": { + "type": "string", + "description": "Body of the SMS message." + }, + "direction": { + "type": "string", + "description": "Value will be inbound to indicate the receipt of a message into the FreeClimb platform." + }, + "applicationId": { + "type": "string", + "description": "ID of the application to which the destination number is assigned." + }, + "status": { + "type": "string", + "description": "Value will be received to indicate that the platform has successfully received the incoming message." + }, + "phoneNumberId": { + "type": "string", + "description": "ID of the destination phone number." + }, + "uri": { + "type": "string", + "description": "The URI for this resource, relative to the API base URL" + } + } + } + ] + }, + "MessageStatusWebhook": { + "description": "An outbound SMS has changed status and the notificationUrl from the Sms command or Send an SMS request is being invoked. A PerCL response will be ignored.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Value will be messageStatus - An outbound SMS has changed status and the Sms command's notificationUrl is being invoked." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "messageId": { + "type": "string", + "description": "Unique ID for this message, generated by FreeClimb." + }, + "callId": { + "type": "string", + "description": "Unique ID for the Call in the context of which the Sms PerCL command was issued." + }, + "from": { + "type": "string", + "description": "aPhone number used to initiate the SMS message (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Destination number of the SMS message (in E.164 format)." + }, + "text": { + "type": "string", + "description": "Body of the SMS message." + }, + "direction": { + "type": "string", + "description": "Value will be outbound to indicate an outgoing SMS from FreeClimb." + }, + "applicationId": { + "type": "string", + "description": "ID of the application to which the destination number is assigned. May be null if the originating number is invalid in some way or is not registered to an application." + }, + "status": { + "$ref": "#/components/schemas/MessageStatus" + }, + "phoneNumberId": { + "type": "string", + "description": "ID of the destination phone number." + } + } + } + ] + }, + "OutDialApiConnectWebhook": { + "description": "An outbound call initiated by the REST API has connected and the callConnectUrl specified in the API request is being invoked. A PerCL response is expected if the call was successfully connected (with status of inProgress).", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be outDialApiConnect - An outbound call spawned by the REST API has connected and the callConnectUrl specified in the API request is being invoked." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "callId": { + "type": "string", + "description": "Unique identifier for this Call, generated by FreeClimb" + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number or SIP URL of the party that is receiving the call (phone number in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "This is only populated if request pertains to a conference. Otherwise, it is set to null.", + "nullable": true + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a queue. Otherwise, it is set to null.", + "nullable": true + }, + "parentCallId": { + "type": "string", + "description": "ID of the Call that created this leg (child call)." + } + } + } + ] + }, + "OutDialConnectWebhook": { + "description": "A Call generated by OutDial has connected and the callConnectUrl is being invoked. This request is made in the context of the Call leg that was generated using OutDial and not the parent (the OutDialStart webhook is invoked on the parent call to continue that call context). A PerCL response is expected if the call was successfully connected (as indicated by status of inProgress) and begins the execution context for this (child) call.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be outDialConnect - A Call generated by OutDial has connected and the callConnectUrl is being invoked." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "callId": { + "type": "string", + "description": "Unique identifier for this Call, generated by FreeClimb" + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number or SIP URL of the party that is receiving the call (phone number in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "This is only populated if request pertains to a conference. Otherwise, it is set to null.", + "nullable": true + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a queue. Otherwise, it is set to null.", + "nullable": true + }, + "parentCallId": { + "type": "string", + "description": "ID of the Call that created this leg (child call)." + } + } + } + ] + }, + "OutDialStartWebhook": { + "description": "The OutDial command has started and the actionUrl is being invoked. This request is made in the context of the parent call (Call leg that invoked). A PerCL response is expected.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be outDialStart - The OutDial command has started and the actionUrl is being invoked." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "callId": { + "type": "string", + "description": "Unique identifier for this Call, generated by FreeClimb" + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to the customer and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "This is only populated if request pertains to a conference. Otherwise, it is set to null.", + "nullable": true + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a queue. Otherwise, it is set to null.", + "nullable": true + }, + "dialCallId": { + "type": "string", + "description": "ID of the child call that was generated as a result of the Outdial." + }, + "parentCallId": { + "type": "string", + "description": "ID of the Call that created this leg (child call). If this was an inbound call or call created via REST API with no parent, this field will be null.", + "nullable": true + } + } + } + ] + }, + "QueueWaitWebhook": { + "description": "A queued Call is requesting instructions to execute during the wait in the Queue and the corresponding waitUrl is being invoked. A PerCL response is expected. The following are the only PerCL commands supported in the PerCL script response to a request to the waitUrl: Play,Say,Pause,GetDigits,Dequeue,Hangup", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be queueWait - A queued call is requesting instructions to execute during the wait in the queue and the corresponding waitUrl is being invoked." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "callId": { + "type": "string", + "description": "Unique identifier for this Call, generated by FreeClimb" + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to the customer and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "This is only populated if request pertains to a conference. Otherwise, it is set to null.", + "nullable": true + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a queue. Otherwise, it is set to null.", + "nullable": true + }, + "queuePosition": { + "type": "string", + "description": "Current queue position of the enqueued Call." + }, + "queueTime": { + "type": "integer", + "description": "Time (in seconds) the Call spent in the Queue. This is only available if the Call was actually enqueued." + }, + "currentQueueSize": { + "type": "integer", + "description": "Current number of enqueued Calls in this Queue." + } + } + } + ] + }, + "RecordWebhook": { + "description": "The RecordUtterance command has completed and its actionUrl is being invoked.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "The context or reason why this request is being made. Will be record - The RecordUtterance command has completed and its actionUrl is being invoked." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "callId": { + "type": "string", + "description": "Unique identifier for this Call, generated by FreeClimb" + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to the customer and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "This is only populated if request pertains to a conference. Otherwise, it is set to null.", + "nullable": true + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a queue. Otherwise, it is set to null.", + "nullable": true + }, + "recordingId": { + "type": "string", + "description": "ID of the recording." + }, + "recordingUrl": { + "type": "string", + "description": "URL of the recorded audio file. This URL can be used as is in a Play command to play the recording (no authentication needed). It can also be used to download a recording file via the REST API.", + "format": "uri" + }, + "recordingSize": { + "type": "string", + "description": "Size of the recording in bytes" + }, + "recordingFormat": { + "type": "string", + "description": "File type of the recording (audio/wav)" + }, + "recordingDurationSec": { + "type": "integer", + "description": "Duration of the recorded audio rounded up to the nearest second (in seconds)" + }, + "termReason": { + "$ref": "#/components/schemas/RecordUtteranceTermReason" + }, + "parentCallId": { + "type": "string", + "description": "ID of Call that created this leg (child call)." + }, + "privacyMode": { + "type": "boolean", + "description": "If true then it indicates the recording will only be available for download for two minutes prior to it being deleted. This is to minimize risk of anyone else getting access to the url and attempting to access it." + } + } + } + ] + }, + "RedirectWebhook": { + "description": "The Redirect command is executing and its actionUrl is being invoked. A PerCL response is expected.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be redirect - The Redirect command is executing and its actionUrl is being invoked." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "callId": { + "type": "string", + "description": "Unique identifier for this Call, generated by FreeClimb" + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to the customer and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "This is only populated if request pertains to a conference. Otherwise, it is set to null.", + "nullable": true + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a queue. Otherwise, it is set to null.", + "nullable": true + }, + "parentCallId": { + "type": "string", + "description": "ID of Call that created this leg (child call)." + } + } + } + ] }, - "PerclCommand": { - "type": "object", - "description": "An individual command used in a PerCLScript.", - "x-percl-command-base": true, - "discriminator": { - "propertyName": "command", - "mapping": { - "AddToConference": "#/components/schemas/AddToConference", - "CreateConference": "#/components/schemas/CreateConference", - "Dequeue": "#/components/schemas/Dequeue", - "Enqueue": "#/components/schemas/Enqueue", - "GetDigits": "#/components/schemas/GetDigits", - "GetSpeech": "#/components/schemas/GetSpeech", - "Hangup": "#/components/schemas/Hangup", - "OutDial": "#/components/schemas/OutDial", - "Pause": "#/components/schemas/Pause", - "Park": "#/components/schemas/Park", - "Play": "#/components/schemas/Play", - "PlayEarlyMedia": "#/components/schemas/PlayEarlyMedia", - "RecordUtterance": "#/components/schemas/RecordUtterance", - "Redirect": "#/components/schemas/Redirect", - "Reject": "#/components/schemas/Reject", - "RemoveFromConference": "#/components/schemas/RemoveFromConference", - "Say": "#/components/schemas/Say", - "SendDigits": "#/components/schemas/SendDigits", - "SetListen": "#/components/schemas/SetListen", - "SetTalk": "#/components/schemas/SetTalk", - "SetDTMFPassThrough": "#/components/schemas/SetDTMFPassThrough", - "Sms": "#/components/schemas/Sms", - "StartRecordCall": "#/components/schemas/StartRecordCall", - "TerminateConference": "#/components/schemas/TerminateConference", - "TranscribeUtterance": "#/components/schemas/TranscribeUtterance", - "Unpark": "#/components/schemas/Unpark" + "RemoveFromQueueNotificationWebhook": { + "description": "A call has been removed from a queue and the Enqueue command’s actionUrl is being invoked. A PerCL response is expected except if reason is hangup.", + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "Context or reason why this request is being made. Will be removeFromQueueNotification - A Call has been removed from a Queue and the Enqueue command’s actionUrl is being invoked." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "callId": { + "type": "string", + "description": "Unique identifier for this Call, generated by FreeClimb" + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to the customer and to which this Call is directed (in E.164 format)." + }, + "callStatus": { + "$ref": "#/components/schemas/CallStatus" + }, + "direction": { + "$ref": "#/components/schemas/CallDirection" + }, + "conferenceId": { + "type": "string", + "description": "This is only populated if request pertains to a conference. Otherwise, it is set to null.", + "nullable": true + }, + "queueId": { + "type": "string", + "description": "This is only populated if the request pertains to a queue. Otherwise, it is set to null.", + "nullable": true + }, + "queueResult": { + "$ref": "#/components/schemas/QueueResultStatus" + }, + "queueTime": { + "type": "integer", + "description": "Time (in seconds) the Call spent in the Queue. This is only available if the Call was actually enqueued." + } + } } - }, - "properties": { - "command": { - "x-is-no-property": true, - "type": "string", - "description": "Name of PerCL Command (this is automatically derived from mapping configuration and should not be manually supplied in any arguments)" + ] + }, + "TranscribeWebhook": { + "allOf": [ + { + "$ref": "#/components/schemas/Webhook" + }, + { + "type": "object", + "properties": { + "requestType": { + "type": "string", + "description": "The context or reason why this request is being made. Will be transcribe - The TranscribeUtterance command has completed and its actionUrl is being invoked." + }, + "accountId": { + "type": "string", + "description": "Account ID associated with your account." + }, + "callId": { + "type": "string", + "description": "Unique identifier for this Call, generated by FreeClimb" + }, + "from": { + "type": "string", + "description": "Phone number of the party that initiated the Call (in E.164 format)." + }, + "to": { + "type": "string", + "description": "Phone number provisioned to the customer and to which this Call is directed (in E.164 format)." + }, + "recordingId": { + "type": "string", + "description": "The ID of the recording. If no recording was made due to errors or the 'saveRecording' flag being disabled this field will be set to null.", + "nullable": true + }, + "recordingUrl": { + "type": "string", + "description": "The URL of the recorded audio file. This URL can be used as is in a Play command to play the recording (no authentication needed). It can also be used to download the recording file via the REST API.", + "format": "uri", + "nullable": true + }, + "recordingSize": { + "type": "integer", + "description": "The size of the recording in bytes." + }, + "recordingFormat": { + "type": "string", + "description": "The media type of the recording.", + "nullable": true + }, + "recordingDurationMs": { + "type": "integer", + "description": "The duration of the recorded audio in milliseconds." + }, + "termReason": { + "$ref": "#/components/schemas/TranscribeTermReason" + }, + "recordTermReason": { + "$ref": "#/components/schemas/RecordUtteranceTermReason" + }, + "digit": { + "type": "string", + "description": "If recordTermReason is digit, this will be the digit that was pressed. Otherwise it will be null.", + "nullable": true + }, + "privacyForLogging": { + "type": "boolean", + "description": "Echo back of the privacyForLogging flag as specified in the transcribe utterance command – confirmation of logging protection has been applied. Can be used by application to know it should also apply protection when handling this request." + }, + "privacyForRecording": { + "type": "boolean", + "description": "Echo back of the privacyForRecording flag as specified in the transcribe utterance command – confirmation of logging protection has been applied. Can be used by application to know it should also apply protection when handling this request." + }, + "bargeInReason": { + "$ref": "#/components/schemas/BargeInReason" + }, + "bargedInPromptNo": { + "type": "integer" + }, + "bargedInPromptMs": { + "type": "integer", + "description": "duration in ms bargedInPromptNo prompt was executing until barge-in occurred." + }, + "bargedInPromptLoopNo": { + "type": "integer" + }, + "bargeInTimeMs": { + "type": "integer", + "description": "epoch time in ms" + }, + "transcript": { + "type": "string", + "description": "Transcribed text of the recording. Can be empty or null. null means there was a failure in transcribing the audio, refer to transcribeReason for detailed failure reason.", + "nullable": true + }, + "transcribeReason": { + "$ref": "#/components/schemas/TranscribeReason" + }, + "transcriptionDurationMs": { + "type": "integer", + "description": "The duration of the audio being transcribed in milliseconds" + } + } } - } + ] }, "AddToConference": { "description": "The `AddToConference` command adds a Participant to a Conference. Two Call legs can be bridged together by creating a Conference and adding both Call legs to it via `AddToConference`.", - "x-percl-command": true, - "x-ref-properties": [ - "false", - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "false", - "\"TEST_STRING\"", - "false", - "false" - ], + "required": ["conferenceId"], "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -512,7 +1924,8 @@ }, "callControlUrl": { "description": "URL to be invoked when this Participant enters the digit sequence defined in the `callControlSequence` attribute.", - "type": "string" + "type": "string", + "format": "uri" }, "conferenceId": { "description": "ID of the Conference to which to add the Participant (Call leg). Conference must exist or an error will result.", @@ -520,6 +1933,7 @@ }, "leaveConferenceUrl": { "description": "URL to be invoked when the Participant leaves the Conference. ", + "format": "uri", "type": "string" }, "listen": { @@ -528,6 +1942,7 @@ }, "notificationUrl": { "description": "When the Participant enters the Conference, this URL will be invoked using an HTTP POST request with the standard request parameters.", + "format": "uri", "type": "string" }, "startConfOnEnter": { @@ -548,16 +1963,6 @@ }, "CreateConference": { "description": "The `CreateConference` command does exactly what its name implies — it creates an unpopulated Conference (one without any Participants). Once created, a Conference remains in FreeClimb until explicitly terminated by a customer. Once a Conference has been terminated, it can no longer be used.", - "x-percl-command": true, - "x-ref-properties": [ - "\"TEST_STRING\"", - "false", - "PlayBeep.ALWAYS", - "false", - "\"https://a.com\"", - "\"https://a.com\"", - "\"TEST_STRING\"" - ], "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -568,8 +1973,8 @@ "properties": { "actionUrl": { "description": " This URL is invoked once the Conference is successfully created. Actions on the Conference, such as adding Participants, can be performed via the PerCL script returned in the response. ", - "type": "string", - "x-is-uri": true + "format": "uri", + "type": "string" }, "alias": { "description": "Descriptive name for the Conference. ", @@ -584,10 +1989,12 @@ }, "statusCallbackUrl": { "description": "This URL is invoked when the status of the Conference changes or when a recording of the Conference has become available.", + "format": "uri", "type": "string" }, "waitUrl": { "description": "If specified, this URL provides the custom hold music for the Conference when it is in the populated state. This attribute is always fetched using HTTP GET and is fetched just once – when the Conference is created. The URL must be an audio file that is reachable and readable by FreeClimb.", + "format": "uri", "type": "string" } } @@ -596,8 +2003,6 @@ }, "Dequeue": { "description": "The `Dequeue` command transfers control of a Call that is in a Queue so that the waiting caller exits the Queue. Execution continues with the first command in the PerCL script returned by the `actionUrl` specified in the `Enqueue` command.", - "x-percl-command": true, - "x-no-properties": true, "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -609,18 +2014,10 @@ }, "Enqueue": { "description": "The `Enqueue` command adds the current Call to a call Queue. If the specified Queue does not exist, it is created and then the Call is added to it. The default maximum length of the queue is 100. This can be modified using the REST API.", - "x-percl-command": true, - "x-ref-properties": [ - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "\"TEST_STRING\"" - ], + "required": ["queueId", "waitUrl", "actionUrl"], "allOf": [ { - "$ref": "#/components/schemas/PerclCommand", - "x-is-uri": true + "$ref": "#/components/schemas/PerclCommand" }, { "type": "object", @@ -629,12 +2026,12 @@ "actionUrl": { "description": "A request is made to this URL when the Call leaves the Queue, which can occur if enqueue of the Call fails or when the call is dequeued via the `Dequeue` command, the REST API (POST to Queue Member resource), or the caller hangs up.", "type": "string", - "x-is-uri": true + "format": "uri" }, "notificationUrl": { "description": "URL to be invoked when the call enters the queue. The request to the URL contains the standard request parameters.This is a notification only; any PerCL returned will be ignored.", "type": "string", - "x-is-uri": true + "format": "uri" }, "queueId": { "description": "ID of the Queue to which to add the Call. If the Queue does not exist, it will be created. The ID must start with QU followed by 40 hex characters.", @@ -642,7 +2039,8 @@ }, "waitUrl": { "description": "A request is made to this URL when the Call leaves the Queue, which can occur if enqueue of the Call fails or when the call is dequeued via the `Dequeue` command, the REST API (POST to Queue Member resource), or the caller hangs up.", - "type": "string" + "type": "string", + "format": "uri" } } } @@ -650,23 +2048,9 @@ }, "GetDigits": { "description": "The `GetDigits` command collects DTMF inputs from the caller. It is only supported only when there is a single party on the Call. `GetDigits` is a Terminal Command — any actions following it are never executed. When the Caller is done entering the digits, FreeClimb submits that data to the provided `actionUrl` using an HTTP POST request. Your server will be required to respond to the FreeClimb Webhook with PerCL to continue handling the call.", - "x-percl-command": true, - "x-ref-properties": [ - "\"https://a.com\"", - "1", - "\"TEST_STRING\"", - "false", - "300", - "1", - "1", - "new List()", - "false", - "\"TEST_STRING\"" - ], "allOf": [ { - "$ref": "#/components/schemas/PerclCommand", - "x-is-uri": true + "$ref": "#/components/schemas/PerclCommand" }, { "type": "object", @@ -675,7 +2059,7 @@ "actionUrl": { "description": "When the Caller has finished entering digits, FreeClimb will make an HTTP POST request to this URL. A PerCL response is expected to continue handling the Call. Make sure to keep “http://“ in the URL.", "type": "string", - "x-is-uri": true + "format": "uri" }, "digitTimeoutMs": { "description": " Maximum time in milliseconds that FreeClimb will wait for the Caller to press any digit after the last digit entered, before making a determination that a `timeout` has occurred and moving on to make the request to the actionUrl to submit the results of the `GetDigits` command. This timeout interval begins and resets after each digit entered.", @@ -704,7 +2088,6 @@ "prompts": { "description": "JSON array of PerCL commands to nest within the `GetDigits` command. The `Say`, `Play`, and `Pause` commands can be used. The nested actions are executed while FreeClimb is waiting for input from the Caller.", "type": "array", - "x-is-list": true, "items": { "$ref": "#/components/schemas/PerclCommand" } @@ -719,23 +2102,6 @@ }, "GetSpeech": { "description": "The `GetSpeech` command enables the Caller to respond to the application using a supported language. Unlike DTMF entry, which implicitly restricts the user to using the available buttons on the phone key pad, speech input allows for flexible audio inputs based on grammar. FreeClimb supports grammars written using GRXML compatible with the Microsoft Speech Platform. `GetSpeech` is only supported on a single call leg. It is not supported when there are two or more call legs connected (as in within a Conference).", - "x-percl-command": true, - "x-ref-properties": [ - "\"https://a.com\"", - "GrammarType.URL", - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "false", - "new List()", - "1", - "1", - "1", - "1", - "1", - "1", - "false", - "\"TEST_STRING\"" - ], "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -747,9 +2113,7 @@ "actionUrl": { "description": "When the caller has finished speaking or the command has timed out, FreeClimb will make a POST request to this URL. A PerCL response is expected to continue handling the call.", "type": "string", - "format": "uri", - "x-is-uri": true, - "x-is-url": true + "format": "uri" }, "grammarType": { "$ref": "#/components/schemas/GrammarType" @@ -771,8 +2135,7 @@ "type": "array", "items": { "$ref": "#/components/schemas/PerclCommand" - }, - "x-is-list": true + } }, "noInputTimeoutMs": { "description": "When recognition is started and there is no speech detected for `noInputTimeoutMs` milliseconds, the recognizer will terminate the recognition operation.", @@ -808,7 +2171,6 @@ }, "Hangup": { "description": "The `Hangup` command terminates a Call. If `Hangup` is used as the first action in a PerCL response, it does not prevent FreeClimb from answering the Call and billing your account. See the `Reject` command to hang up at no charge.", - "x-percl-command": true, "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -826,24 +2188,9 @@ }, "OutDial": { "description": "The OutDial command is used to call a phone number", - "x-percl-command": true, - "x-ref-properties": [ - "\"https://a.com\"", - "\"https://a.com\"", - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "IfMachine.REDIRECT", - "\"https://a.com\"", - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "1", - "false", - "\"TEST_STRING\"" - ], "allOf": [ { - "$ref": "#/components/schemas/PerclCommand", - "x-is-uri": true + "$ref": "#/components/schemas/PerclCommand" }, { "required": [ @@ -857,12 +2204,12 @@ "actionUrl": { "description": "URL to which FreeClimb sends an HTTP POST request. ", "type": "string", - "x-is-uri": true + "format": "uri" }, "callConnectUrl": { "description": "URL to which FreeClimb makes an HTTP POST request informing the result of the OutDial.", "type": "string", - "x-is-uri": true + "format": "uri" }, "callingNumber": { "description": "he caller ID to show to the called party when FreeClimb calls. This can be one of the following: The To or From number provided in the first Webhook to your webserver. Any phone number you have purchased from FreeClimb.", @@ -877,6 +2224,7 @@ }, "ifMachineUrl": { "description": "When the `ifMachine` flag is set to `redirect`, this attribute specifies a URL to which FreeClimb makes a POST request when an answering machine or a fax machine is detected. This URL is required if the `ifMachine` flag is set to `redirect`. Otherwise, it should not be included.", + "format": "uri", "type": "string" }, "sendDigits": { @@ -885,6 +2233,7 @@ }, "statusCallbackUrl": { "description": "When the outdialed Call leg terminates, FreeClimb sends a `callStatus` Webhook to the `statusCallbackUrl`. This is a notification only; any PerCL command returned is ignored.", + "format": "uri", "type": "string" }, "timeout": { @@ -901,17 +2250,9 @@ }, "Park": { "description": "The `Park` command allows a caller to be put on hold. You can provide hold music,messages,etc until ready to resume the call. Park is a terminal command. Actions performed on the Call while on hold are provided in a PerCL script in response to the waitUrl property. Actions performed on the Call after it has been unparked (resumed) will be provided in a PerCL script in response to the actionUrl provided. A Call can be resumed in two ways -- REST API invocation or the Unpark percl command. No actions can be nested within Park and Park cannot be nested in any other actions. ", - "x-percl-command": true, - "x-ref-properties": [ - "\"https://a.com\"", - "\"https://a.com\"", - "\"TEST_STRING\"", - "\"TEST_STRING\"" - ], "allOf": [ { - "$ref": "#/components/schemas/PerclCommand", - "x-is-uri": true + "$ref": "#/components/schemas/PerclCommand" }, { "type": "object", @@ -920,16 +2261,17 @@ "waitUrl": { "description": "Specifies a URL pointing to a PerCL script containing actions to be executed while the caller is Parked. Once the script returned by the waitUrl runs out of commands to execute, FreeClimb will re-request the waitUrl and start over, essentially looping the script requests indefinitely.", "type": "string", - "x-is-uri": true + "format": "uri" }, "actionUrl": { "description": "A request is made to this URL when the Call is resumed, which can occur if the Call is resumed via the Unpark command, the REST API (POST to Call resource), or the caller hangs up. The PerCL script returned in response to the actionUrl will be executed on the resumed call.", "type": "string", - "x-is-uri": true + "format": "uri" }, "notificationUrl": { "description": "URL to be invoked when the Call is parked. The request to the URL contains the standard request parameters.", - "type": "string" + "type": "string", + "format": "uri" } } } @@ -937,8 +2279,6 @@ }, "Pause": { "description": "The `Pause` command halts execution of the current PerCL script for a specified number of milliseconds. If `Pause` is the first command in a PerCL document, FreeClimb will wait for the specified time to elapse before picking up the call.", - "x-percl-command": true, - "x-ref-properties": ["1"], "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -957,8 +2297,6 @@ }, "Play": { "description": "The `Play` command plays an audio file back to the caller. The audio file may be located at any location accessible via a URL. `Play` can exist as a stand-alone command or as a nested command. It does not allow barge-in unless nested within a `GetSpeech` command. The file will always be played to completion unless nested.", - "x-percl-command": true, - "x-ref-properties": ["\"TEST_STRING\"", "1", "false"], "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -985,8 +2323,6 @@ }, "PlayEarlyMedia": { "description": "`PlayEarlyMedia` is relevant only when present as the very first command in the PerCL script returned for an incoming Call. In such cases, the command is executed before FreeClimb attempts to connect the call. The audio file it uses can be stored in any location that is accessible via URL.", - "x-percl-command": true, - "x-ref-properties": ["\"TEST_STRING\""], "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -1005,20 +2341,9 @@ }, "RecordUtterance": { "description": "The `RecordUtterance` command records the caller's voice and returns the URL of a file containing the audio recording. `RecordUtterance` is blocking and is a terminal command. As such, the `actionUrl` property is required, and control of the Call picks up using the PerCL returned in response to the `actionUrl`. Recording information is returned in the `actionUrl` request.", - "x-percl-command": true, - "x-ref-properties": [ - "\"https://a.com\"", - "1", - "\"TEST_STRING\"", - "1", - "false", - "false", - "false" - ], "allOf": [ { - "$ref": "#/components/schemas/PerclCommand", - "x-is-uri": true + "$ref": "#/components/schemas/PerclCommand" }, { "required": ["actionUrl"], @@ -1027,7 +2352,7 @@ "actionUrl": { "description": "URL to which information on the completed recording is submitted. The PerCL received in response is then used to continue with Call processing.", "type": "string", - "x-is-uri": true + "format": "uri" }, "silenceTimeoutMs": { "description": "Interval of silence that should elapse before ending the recording.", @@ -1059,12 +2384,9 @@ }, "Redirect": { "description": "The `Redirect` command transfers control of a Call to the PerCL at a different URL. `Redirect` is a terminal command, so any actions following it are never executed. The maximum number of redirections allowed during the life time of a Call is 256. This is intended to prevent a Call from possibly looping infinitely due to errors in PerCL being generated.", - "x-percl-command": true, - "x-ref-properties": ["\"https://a.com\""], "allOf": [ { - "$ref": "#/components/schemas/PerclCommand", - "x-is-uri": true + "$ref": "#/components/schemas/PerclCommand" }, { "required": ["actionUrl"], @@ -1073,7 +2395,7 @@ "actionUrl": { "description": "URL to request a new PerCL script to continue with the current Call's processing. When `Redirect` invokes the `actionUrl`, an `inbound` Webhook is sent. This request therefore looks identical to the initial request (made to the `voiceUrl` of the number that was called) for an inbound Call.", "type": "string", - "x-is-uri": true + "format": "uri" } } } @@ -1081,8 +2403,6 @@ }, "Reject": { "description": "The `Reject` command blocks an incoming Call. Using `Reject` is the only way to prevent FreeClimb from answering a Call. Any other response will result in an answered Call and your account will be billed.", - "x-percl-command": true, - "x-ref-properties": ["\"TEST_STRING\""], "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -1100,8 +2420,6 @@ }, "RemoveFromConference": { "description": "The `RemoveFromConference` command removes a Participant from a Conference but does not hang up. Instead, the Call is simply unbridged and what happens next with the Call is determined by the PerCL returned in response to the `leaveConferenceUrl` attribute.", - "x-percl-command": true, - "x-no-properties": true, "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -1115,13 +2433,6 @@ }, "Say": { "description": "The `Say` command provides Text-To-Speech (TTS) support. It converts text to speech and then renders it in a female voice back to the caller. `Say` is useful in cases where it's difficult to pre-record a prompt for any reason. `Say` does not allow barge-in unless nested within a `GetSpeech` command. The file will always be played to completion unless nested.", - "x-percl-command": true, - "x-ref-properties": [ - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "1", - "false" - ], "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -1153,8 +2464,6 @@ }, "SendDigits": { "description": "The `SendDigits` command plays DTMF tones on a live Call. This is useful for navigating through IVR menus or dialing extensions.", - "x-percl-command": true, - "x-ref-properties": ["\"TEST_STRING\"", "1", "false"], "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -1181,8 +2490,6 @@ }, "SetListen": { "description": "The `SetListen` command enables or disables the listen privilege for this Conference Participant. The Participant can hear what the other participants are saying only if this privilege is enabled.", - "x-percl-command": true, - "x-ref-properties": ["false"], "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -1201,8 +2508,6 @@ }, "SetTalk": { "description": "The `SetTalk` command enables or disables the talk privilege for this Conference Participant. If 'true', no audio from that Participant is shared with the other Participants of the Conference.", - "x-percl-command": true, - "x-ref-properties": ["false"], "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -1221,8 +2526,6 @@ }, "SetDTMFPassThrough": { "description": "The `SetDTMFPassThrough` command enables or disables the dtmfPassThrough privilege for this Conference Participant. If 'true', DTMFs will be passed through from this Participant to all other Participants in the Conference", - "x-percl-command": true, - "x-ref-properties": ["false"], "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -1241,12 +2544,6 @@ }, "Sms": { "description": "The `Sms` command can be used to send an SMS message to a phone number during a phone call. International SMS is disabled by default.", - "x-percl-command": true, - "x-ref-properties": [ - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "\"TEST_STRING\"" - ], "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -1269,7 +2566,8 @@ }, "notificationUrl": { "description": "When the message changes status, this URL will be invoked using HTTP POST with the messageStatus parameters. This is a notification only; any PerCL returned will be ignored.", - "type": "string" + "type": "string", + "format": "uri" } } } @@ -1277,8 +2575,6 @@ }, "StartRecordCall": { "description": "The `StartRecordCall` command records the current call and returns the URL of a file containing the audio recording when recording completes. `StartRecordCall` is non-blocking. After recording of the current call begins, control of the call moves to the PerCL command that follows `StartRecordCall` in the current PerCL script.", - "x-percl-command": true, - "x-no-properties": true, "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -1290,8 +2586,6 @@ }, "TerminateConference": { "description": "The `TerminateConference` command terminates an existing Conference. Any active participants are hung up on by FreeClimb. If this is not the desired behavior, use the `RemoveFromConference` command to unbridge Calls that should not be hung up. Note: The Call requesting TerminateConference must be on the same Conference for this command to execute.", - "x-percl-command": true, - "x-no-properties": true, "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -1305,8 +2599,6 @@ }, "Unpark": { "description": "The `Unpark` command resumes a parked call. Execution continues with the first command in the PerCL scripted returned by the actionUrl specified in the Park command as long as the call is still in progress. If the call is no longer in progress, any returned PerCL will not be executed. Unpark is a terminal command -- any commands following it in the same script are not executed.", - "x-percl-command": true, - "x-no-properties": true, "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -1381,8 +2673,6 @@ "description": "Details for which features this number may be used.", "type": "object", "required": ["voice", "sms", "tollFree", "tenDLC", "shortCode"], - "x-is-object": true, - "x-ref-properties": [false, false, false, false, false], "properties": { "voice": { "description": "Indicates whether a number can be used for voice calls. Replaces voiceEnabled.", @@ -1415,8 +2705,6 @@ "description": "TollFree Campaign details for this number", "type": "object", "required": ["campaignId"], - "x-is-object": true, - "x-ref-properties": ["\"TEST_STRING\""], "properties": { "campaignId": { "description": "alphanumeric identifier for the TollFree campaign associated with this number", @@ -1506,31 +2794,37 @@ "voiceUrl": { "type": "string", "description": "The URL FreeClimb will request when a phone number assigned to this Application receives a Call. Used for inbound calls only.", + "format": "uri", "nullable": true }, "voiceFallbackUrl": { "type": "string", "description": "The URL that FreeClimb will request if it times out waiting for a response from the voiceUrl. Used for inbound calls only.", + "format": "uri", "nullable": true }, "callConnectUrl": { "type": "string", "description": "The URL to which FreeClimb will make a POST request informing the result of the outbound Call request. The status property of the request message specifies if the Call was connected or not.", + "format": "uri", "nullable": true }, "statusCallbackUrl": { "type": "string", "description": "A URL to which FreeClimb will make a POST request when the Call ends to notify this app.", + "format": "uri", "nullable": true }, "smsUrl": { "type": "string", "description": "The URL FreeClimb will request when a phone number assigned to this Application receives an incoming SMS message. Used for inbound SMS only.", + "format": "uri", "nullable": true }, "smsFallbackUrl": { "type": "string", "description": "The URL that FreeClimb will request if it times out waiting for a response from the smsUrl. Used for inbound SMS only.", + "format": "uri", "nullable": true } } @@ -1547,37 +2841,42 @@ "voiceUrl": { "type": "string", "description": "The URL that FreeClimb will request when an inbound call arrives on a phone number assigned to this application. Used only for inbound calls.", + "format": "uri", "nullable": true }, "voiceFallbackUrl": { "type": "string", "description": "The URL that FreeClimb will request if it times out waiting for a response from the voiceUrl. Used for inbound calls only. Note: A PerCL response is expected to control the inbound call.", + "format": "uri", "nullable": true }, "callConnectUrl": { "type": "string", "description": "The URL that FreeClimb will request when an outbound call request is complete. Used for outbound calls only. Note: A PerCL response is expected if the outbound call is connected (status=InProgress) to control the call.", + "format": "uri", "nullable": true }, "statusCallbackUrl": { "type": "string", "description": "The URL that FreeClimb will request to pass call status (such as call ended) to the application. Note: This is a notification only; any PerCL returned will be ignored.", + "format": "uri", "nullable": true }, "smsUrl": { "type": "string", "description": "The URL that FreeClimb will request when a phone number assigned to this application receives an incoming SMS message. Used for inbound SMS only. Note: Any PerCL returned will be ignored.", + "format": "uri", "nullable": true }, "smsFallbackUrl": { "type": "string", "description": "The URL that FreeClimb will request if it times out waiting for a response from the smsUrl. Used for inbound SMS only. Note: Any PerCL returned will be ignored.", + "format": "uri", "nullable": true } } }, "ApplicationList": { - "x-implements": "Pagination", "allOf": [ { "$ref": "#/components/schemas/PaginationModel" @@ -1590,8 +2889,7 @@ "items": { "$ref": "#/components/schemas/ApplicationResult" }, - "nullable": true, - "x-is-list": true + "nullable": true } } } @@ -1638,7 +2936,6 @@ } }, "AvailableNumberList": { - "x-implements": "Pagination", "allOf": [ { "$ref": "#/components/schemas/PaginationModel" @@ -1651,8 +2948,7 @@ "items": { "$ref": "#/components/schemas/AvailableNumber" }, - "nullable": true, - "x-is-list": true + "nullable": true } } } @@ -1753,7 +3049,6 @@ } }, "IncomingNumberList": { - "x-implements": "Pagination", "allOf": [ { "$ref": "#/components/schemas/PaginationModel" @@ -1766,8 +3061,7 @@ "items": { "$ref": "#/components/schemas/IncomingNumberResult" }, - "nullable": true, - "x-is-list": true + "nullable": true } } } @@ -1912,7 +3206,8 @@ }, "ifMachineUrl": { "type": "string", - "description": "This attribute specifies a URL to which FreeClimb will make a POST request when an answering machine or a fax machine is detected. This URL is required if the ifMachine flag is set to redirect. When ifMachine is set to hangup, ifMachineUrl must not be included in the request. For more information, see **ifMachineUrl example** below." + "description": "This attribute specifies a URL to which FreeClimb will make a POST request when an answering machine or a fax machine is detected. This URL is required if the ifMachine flag is set to redirect. When ifMachine is set to hangup, ifMachineUrl must not be included in the request. For more information, see **ifMachineUrl example** below.", + "format": "uri" }, "timeout": { "type": "integer", @@ -1930,12 +3225,12 @@ }, "callConnectUrl": { "type": "string", - "description": "The URL that FreeClimb should use to handle this phone call. If an applicationId or parentCallId have already been provided, this callConnectUrl attribute will be used as a replacement of the callConnectUrl originally assigned in the application or parent call." + "description": "The URL that FreeClimb should use to handle this phone call. If an applicationId or parentCallId have already been provided, this callConnectUrl attribute will be used as a replacement of the callConnectUrl originally assigned in the application or parent call.", + "format": "uri" } } }, "CallList": { - "x-implements": "Pagination", "allOf": [ { "$ref": "#/components/schemas/PaginationModel" @@ -1948,8 +3243,7 @@ "items": { "$ref": "#/components/schemas/CallResult" }, - "nullable": true, - "x-is-list": true + "nullable": true } } } @@ -1993,7 +3287,6 @@ ] }, "RecordingList": { - "x-implements": "Pagination", "allOf": [ { "$ref": "#/components/schemas/PaginationModel" @@ -2006,8 +3299,7 @@ "items": { "$ref": "#/components/schemas/RecordingResult" }, - "nullable": true, - "x-is-list": true + "nullable": true } } } @@ -2052,7 +3344,6 @@ } }, "LogList": { - "x-implements": "Pagination", "allOf": [ { "$ref": "#/components/schemas/PaginationModel" @@ -2065,8 +3356,7 @@ "items": { "$ref": "#/components/schemas/LogResult" }, - "nullable": true, - "x-is-list": true + "nullable": true } } } @@ -2110,16 +3400,19 @@ "waitUrl": { "type": "string", "description": "URL referencing the audio file to be used as default wait music for the Conference when it is in the populated state.", + "format": "uri", "nullable": true }, "actionUrl": { "type": "string", "description": "URL invoked once the Conference is successfully created.", + "format": "uri", "nullable": true }, "statusCallbackUrl": { "type": "string", "description": "URL to inform that the Conference status has changed.", + "format": "uri", "nullable": true }, "subresourceUris": { @@ -2132,7 +3425,6 @@ ] }, "MessagesList": { - "x-implements": "Pagination", "allOf": [ { "$ref": "#/components/schemas/PaginationModel" @@ -2146,8 +3438,7 @@ "items": { "$ref": "#/components/schemas/MessageResult" }, - "nullable": true, - "x-is-list": true + "nullable": true } } } @@ -2176,12 +3467,12 @@ }, "notificationUrl": { "type": "string", - "description": "When the Message changes status, this URL is invoked using HTTP POST with the messageStatus parameters. **Note:** This is a notification only; any PerCL returned is ignored." + "description": "When the Message changes status, this URL is invoked using HTTP POST with the messageStatus parameters. **Note:** This is a notification only; any PerCL returned is ignored.", + "format": "uri" }, "mediaUrls": { "type": "array", "description": "an array of HTTP URLs which are to be used as attachments to the message. This will force the message into being an MMS message and must be done using a from number which is MMS capabile.", - "x-is-list": true, "items": { "type": "string", "format": "uri" @@ -2206,26 +3497,17 @@ "CompletionResult": { "type": "object", "required": ["response", "status"], - "x-completion-result": true, "properties": { "response": { "type": "string", "description": "The generative response from the KnowledgeBase" }, "status": { - "type": "string", - "x-has-writer": true, - "description": "Completion result status. Possible values: success, no_context", - "x-enum-type": "CompletionResultStatusEnum", - "x-enum-type-c-sharp": "StatusEnum", - "enum": ["success", "no_context"], - "x-enum-varnames": ["SUCCESS", "NO_CONTEXT"], - "x-enum-varnames-values": ["success", "no_context"] + "$ref": "#/components/schemas/CompletionResultStatus" } } }, "ConferenceList": { - "x-implements": "Pagination", "allOf": [ { "$ref": "#/components/schemas/PaginationModel" @@ -2238,8 +3520,7 @@ "items": { "$ref": "#/components/schemas/ConferenceResult" }, - "nullable": true, - "x-is-list": true + "nullable": true } } } @@ -2289,6 +3570,7 @@ "notificationUrl": { "type": "string", "description": "URL invoked when message sent", + "format": "uri", "nullable": true }, "brandId": { @@ -2309,7 +3591,6 @@ "mediaUrls": { "type": "array", "description": "an array of HTTP URLs which were attached this this message", - "x-is-list": true, "items": { "type": "string", "format": "uri" @@ -2336,11 +3617,13 @@ }, "waitUrl": { "type": "string", - "description": "If specified, a URL for the audio file that provides custom hold music for the Conference when it is in the populated state. Otherwise, FreeClimb uses a system default audio file. This is always fetched using HTTP GET and is fetched just once — when the Conference is created." + "description": "If specified, a URL for the audio file that provides custom hold music for the Conference when it is in the populated state. Otherwise, FreeClimb uses a system default audio file. This is always fetched using HTTP GET and is fetched just once — when the Conference is created.", + "format": "uri" }, "statusCallbackUrl": { "type": "string", - "description": "This URL is invoked when the status of the Conference changes. For more information, see **statusCallbackUrl** (below)." + "description": "This URL is invoked when the status of the Conference changes. For more information, see **statusCallbackUrl** (below).", + "format": "uri" } } }, @@ -2424,7 +3707,6 @@ } }, "ConferenceParticipantList": { - "x-implements": "Pagination", "allOf": [ { "$ref": "#/components/schemas/PaginationModel" @@ -2437,8 +3719,7 @@ "items": { "$ref": "#/components/schemas/ConferenceParticipantResult" }, - "nullable": true, - "x-is-list": true + "nullable": true } } } @@ -2507,7 +3788,6 @@ } }, "QueueList": { - "x-implements": "Pagination", "allOf": [ { "$ref": "#/components/schemas/PaginationModel" @@ -2520,8 +3800,7 @@ "items": { "$ref": "#/components/schemas/QueueResult" }, - "nullable": true, - "x-is-list": true + "nullable": true } } } @@ -2558,7 +3837,6 @@ } }, "QueueMemberList": { - "x-implements": "Pagination", "allOf": [ { "$ref": "#/components/schemas/PaginationModel" @@ -2571,8 +3849,7 @@ "items": { "$ref": "#/components/schemas/QueueMember" }, - "nullable": true, - "x-is-list": true + "nullable": true } } } @@ -2589,7 +3866,6 @@ } }, "SMSTenDLCCampaignsListResult": { - "x-implements": "Pagination", "allOf": [ { "$ref": "#/components/schemas/PaginationModel" @@ -2602,8 +3878,7 @@ "items": { "$ref": "#/components/schemas/SMSTenDLCCampaign" }, - "nullable": true, - "x-is-list": true + "nullable": true } } } @@ -2641,19 +3916,12 @@ "description": "Alphanumeric identifier of the reseller that you want to associate with this campaign." }, "status": { - "type": "string", - "x-has-writer": true, - "description": "Current campaign status. Possible values: ACTIVE, EXPIRED. A newly created campaign defaults to ACTIVE status. ", - "x-enum-type": "SMSTenDLCCampaignStatusEnum", - "x-enum-type-c-sharp": "StatusEnum", - "enum": ["ACTIVE", "EXPIRED"], - "x-enum-varnames": ["ACTIVE", "EXPIRED"] + "$ref": "#/components/schemas/SMSTenDLCCampaignStatus" }, "createDate": { "type": "string", "description": "Unix timestamp when campaign was created.", - "format": "date-time", - "x-is-date-time": true + "format": "date-time" }, "autoRenewal": { "type": "boolean", @@ -2663,7 +3931,6 @@ "type": "string", "description": "Campaign recent billed date.", "format": "date-time", - "x-is-date-time": true, "nullable": true }, "brandId": { @@ -2678,7 +3945,6 @@ }, "subUsecases": { "uniqueItems": true, - "x-is-set": true, "type": "array", "description": "Campaign sub-usecases. Must be of defined valid sub-usecase types. Use `/registry/enum/usecase` operation to retrieve list of valid sub-usecases", "items": { @@ -2813,7 +4079,6 @@ "nullable": true, "description": "When the campaign would be due for its next renew/bill date.", "format": "date", - "x-is-date": true, "example": "2000-01-01" } }, @@ -2852,7 +4117,6 @@ } }, "SMSTenDLCPartnerCampaignsListResult": { - "x-implements": "Pagination", "allOf": [ { "$ref": "#/components/schemas/PaginationModel" @@ -2865,8 +4129,7 @@ "items": { "$ref": "#/components/schemas/SMSTenDLCPartnerCampaign" }, - "nullable": true, - "x-is-list": true + "nullable": true } } } @@ -2886,19 +4149,12 @@ "description": "Alphanumeric identifier assigned by the registry for a campaign. This identifier is required by the NetNumber OSR SMS enabling process of 10DLC." }, "status": { - "type": "string", - "x-has-writer": true, - "description": "Current campaign status. Possible values: ACTIVE, EXPIRED. A newly created campaign defaults to ACTIVE status. ", - "x-enum-type": "SMSTenDLCPartnerCampaignStatusEnum", - "x-enum-type-c-sharp": "StatusEnum", - "enum": ["ACTIVE", "EXPIRED"], - "x-enum-varnames": ["ACTIVE", "EXPIRED"] + "$ref": "#/components/schemas/SMSTenDLCPartnerCampaignStatus" }, "createDate": { "type": "string", "description": "Unix timestamp when campaign was created.", - "format": "date-time", - "x-is-date-time": true + "format": "date-time" }, "brandId": { "maxLength": 8, @@ -3023,8 +4279,7 @@ "description": "Subscriber opt-out message." }, "brand": { - "$ref": "#/components/schemas/SMSTenDLCPartnerCampaignBrand", - "x-partner-campaign-brand": true + "$ref": "#/components/schemas/SMSTenDLCPartnerCampaignBrand" } }, "example": { @@ -3073,20 +4328,6 @@ "SMSTenDLCPartnerCampaignBrand": { "required": ["email", "phone"], "type": "object", - "x-is-object": true, - "x-sms-ten-dlc-partner-campaign-brand": true, - "x-ref-properties": [ - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "\"TEST_STRING\"", - "new Dictionary()", - "1" - ], "properties": { "accountId": { "type": "string", @@ -3140,14 +4381,7 @@ "example": "http://www.abcmobile.com" }, "optionalAttributes": { - "x-is-map": true, - "type": "object", - "x-is-hash": true, - "additionalProperties": { - "type": "object", - "description": "Optional brand attributes. Please refer to GET /enum/optionalAttributeNames for dictionary of optional attribute names." - }, - "description": "Optional brand attributes. Please refer to GET /enum/optionalAttributeNames for dictionary of optional attribute names." + "$ref": "#/components/schemas/SMSTenDLCOptionalAttributes" }, "evpVettingScore": { "type": "integer", @@ -3156,7 +4390,6 @@ } }, "SMSTenDLCBrandsListResult": { - "x-implements": "Pagination", "allOf": [ { "$ref": "#/components/schemas/PaginationModel" @@ -3169,8 +4402,7 @@ "items": { "$ref": "#/components/schemas/SMSTenDLCBrand" }, - "nullable": true, - "x-is-list": true + "nullable": true } } } @@ -3189,7 +4421,6 @@ "vertical" ], "type": "object", - "x-sms-ten-dlc-brand": true, "properties": { "accountId": { "type": "string", @@ -3197,26 +4428,7 @@ "nullable": true }, "entityType": { - "maxLength": 20, - "type": "string", - "x-has-writer": true, - "description": "Entity type behind the brand. This is the form of business establishment.", - "x-enum-type": "SMSTenDLCBrandEntityTypeEnum", - "x-enum-type-c-sharp": "EntityTypeEnum", - "enum": [ - "PRIVATE_PROFIT", - "PUBLIC_PROFIT", - "NON_PROFIT", - "GOVERNMENT", - "SOLE_PROPRIETOR" - ], - "x-enum-varnames": [ - "PRIVATE_PROFIT", - "PUBLIC_PROFIT", - "NON_PROFIT", - "GOVERNMENT", - "SOLE_PROPRIETOR" - ] + "$ref": "#/components/schemas/SMSTenDLCBrandEntityType" }, "cspId": { "type": "string", @@ -3312,70 +4524,7 @@ "example": "ABC" }, "stockExchange": { - "type": "string", - "x-has-writer": true, - "description": "(Required for public company) stock exchange.", - "example": "NASDAQ", - "x-enum-type": "SMSTenDLCBrandStockExchangeEnum", - "x-enum-type-c-sharp": "StockExchangeEnum", - "enum": [ - "NONE", - "NASDAQ", - "NYSE", - "AMEX", - "AMX", - "ASX", - "B3", - "BME", - "BSE", - "FRA", - "ICEX", - "JPX", - "JSE", - "KRX", - "LON", - "NSE", - "OMX", - "SEHK", - "SGX", - "SSE", - "STO", - "SWX", - "SZSE", - "TSX", - "TWSE", - "VSE", - "OTHER" - ], - "x-enum-varnames": [ - "NONE", - "NASDAQ", - "NYSE", - "AMEX", - "AMX", - "ASX", - "B3", - "BME", - "BSE", - "FRA", - "ICEX", - "JPX", - "JSE", - "KRX", - "LON", - "NSE", - "OMX", - "SEHK", - "SGX", - "SSE", - "STO", - "SWX", - "SZSE", - "TSX", - "TWSE", - "VSE", - "OTHER" - ] + "$ref": "#/components/schemas/SMSTenDLCBrandStockExchange" }, "ipAddress": { "maxLength": 50, @@ -3389,25 +4538,7 @@ "example": "http://www.abcmobile.com" }, "brandRelationship": { - "type": "string", - "x-has-writer": true, - "description": "Brand relationship to the CSP", - "x-enum-type": "SMSTenDLCBrandBrandRelationshipEnum", - "x-enum-type-c-sharp": "BrandRelationshipEnum", - "enum": [ - "BASIC_ACCOUNT", - "SMALL_ACCOUNT", - "MEDIUM_ACCOUNT", - "LARGE_ACCOUNT", - "KEY_ACCOUNT" - ], - "x-enum-varnames": [ - "BASIC_ACCOUNT", - "SMALL_ACCOUNT", - "MEDIUM_ACCOUNT", - "LARGE_ACCOUNT", - "KEY_ACCOUNT" - ] + "$ref": "#/components/schemas/SMSTenDLCBrandRelationship" }, "vertical": { "maxLength": 50, @@ -3420,13 +4551,7 @@ "description": "Alternate business identifier such as DUNS, LEI, or GIIN" }, "altBusinessIdType": { - "type": "string", - "x-has-writer": true, - "x-enum-type": "SMSTenDLCBrandAltBusinessIdTypeEnum", - "x-enum-type-c-sharp": "AltBusinessIdTypeEnum", - "enum": ["NONE", "DUNS", "GIIN", "LEI"], - "x-enum-varnames": ["NONE", "DUNS", "GIIN", "LEI"], - "description": "The type of the Alternative business identifier" + "$ref": "#/components/schemas/SMSTenDLCBrandAltBusinessIdType" }, "universalEin": { "type": "string", @@ -3439,43 +4564,19 @@ "description": "Caller supplied brand reference ID. If supplied, the value must be unique across all submitted brands. Can be used to prevent duplicate brand registrations." }, "optionalAttributes": { - "x-is-map": true, - "type": "object", - "x-is-hash": true, - "additionalProperties": { - "type": "object", - "description": "Optional brand attributes. Please refer to GET /enum/optionalAttributeNames for dictionary of optional attribute names." - }, - "description": "Optional brand attributes. Please refer to GET /enum/optionalAttributeNames for dictionary of optional attribute names." + "$ref": "#/components/schemas/SMSTenDLCOptionalAttributes" }, "mock": { "type": "boolean", "description": "Test brand." }, "identityStatus": { - "type": "string", - "x-has-writer": true, - "description": "TCR assessment of the brand identification status.", - "x-enum-type": "SMSTenDLCBrandIdentityStatusEnum", - "x-enum-type-c-sharp": "IdentityStatusEnum", - "enum": [ - "SELF_DECLARED", - "UNVERIFIED", - "VERIFIED", - "VETTED_VERIFIED" - ], - "x-enum-varnames": [ - "SELF_DECLARED", - "UNVERIFIED", - "VERIFIED", - "VETTED_VERIFIED" - ] + "$ref": "#/components/schemas/SMSTenDLCBrandIdentityStatus" }, "createDate": { "type": "string", "description": "Unix timestamp when brand was created.", - "format": "date-time", - "x-is-date-time": true + "format": "date-time" } }, "description": "A brand is a business identity behind the campaign.", @@ -3512,7 +4613,6 @@ } }, "SMSTollFreeCampaignsListResult": { - "x-implements": "Pagination", "allOf": [ { "$ref": "#/components/schemas/PaginationModel" @@ -3525,8 +4625,7 @@ "items": { "$ref": "#/components/schemas/SMSTollFreeCampaign" }, - "nullable": true, - "x-is-list": true + "nullable": true } } } @@ -3543,7 +4642,6 @@ "dateUpdated", "revision" ], - "x-sms-toll-free-campaign": true, "properties": { "accountId": { "type": "string", @@ -3558,25 +4656,7 @@ "type": "string" }, "registrationStatus": { - "type": "string", - "x-has-writer": true, - "description": "Current toll-free campaign registration status.Possible values: UNREGISTERED,INITIATED,PENDING,DECLINED,REGISTERED. A newly created campaign defaults to INITIATED status. ", - "x-enum-type": "SMSTollFreeCampaignRegistrationStatusEnum", - "x-enum-type-c-sharp": "RegistrationStatusEnum", - "enum": [ - "UNREGISTERED", - "INITIATED", - "PENDING", - "DECLINED", - "REGISTERED" - ], - "x-enum-varnames": [ - "UNREGISTERED", - "INITIATED", - "PENDING", - "DECLINED", - "REGISTERED" - ] + "$ref": "#/components/schemas/SMSTollFreeCampaignRegistrationStatus" }, "dateCreated": { "type": "string" @@ -3589,22 +4669,32 @@ } } }, + "TranscribeUtteranceRecord": { + "type": "object", + "properties": { + "saveRecording": { + "type": "boolean", + "default": false + }, + "maxLengthSec": { + "type": "integer", + "minimum": 1, + "maximum": 60, + "default": 60 + }, + "rcrdTerminationSilenceTimeMs": { + "type": "integer", + "minimum": 1, + "maximum": 3000 + } + } + }, "TranscribeUtterance": { "title": "TranscribeUtterance", "x-stoplight": { "id": "u509r3zqc38ze" }, "description": "The `TranscribeUtterance` command transcribes the caller’s voice and returns transcription of the audio and optionally returns the recording of the audio transcribed.\n\n`TranscribeUtterance` is blocking and is a terminal command. As such, the actionUrl property is required, and control of the Call picks up using the `PerCL` returned in response of the `actionUrl`. Recording and Transcription information is returned in the actionUrl request. If the reason this command ended was due to the call hanging up, any PerCL returned will not execute.", - "x-percl-command": true, - "x-ref-properties": [ - "\"TEST_STRING\"", - "false", - "new TranscribeUtteranceAllOfRecord()", - "false", - "false", - "new List()", - "\"TEST_STRING\"" - ], "allOf": [ { "$ref": "#/components/schemas/PerclCommand" @@ -3615,33 +4705,15 @@ "description": "The `TranscribeUtterance` command transcribes the caller’s voice and returns transcription of the audio and optionally returns the recording of the audio transcribed.\n\n`TranscribeUtterance` is blocking and is a terminal command. As such, the actionUrl property is required, and control of the Call picks up using the `PerCL` returned in response of the `actionUrl`. Recording and Transcription information is returned in the actionUrl request. If the reason this command ended was due to the call hanging up, any PerCL returned will not execute.", "properties": { "actionUrl": { - "type": "string" + "type": "string", + "format": "uri" }, "playBeep": { "type": "boolean", "default": false }, "record": { - "type": "object", - "x-is-object": true, - "properties": { - "saveRecording": { - "type": "boolean", - "default": false - }, - "maxLengthSec": { - "type": "integer", - "minimum": 1, - "maximum": 60, - "default": 60 - }, - "rcrdTerminationSilenceTimeMs": { - "type": "integer", - "exclusiveMinimum": true, - "minimum": 0, - "maximum": 3000 - } - } + "$ref": "#/components/schemas/TranscribeUtteranceRecord" }, "privacyForLogging": { "type": "boolean", @@ -3653,8 +4725,9 @@ }, "prompts": { "type": "array", - "x-is-list": true, - "items": {} + "items": { + "$ref": "#/components/schemas/PerclCommand" + } } } } @@ -3683,7 +4756,6 @@ "CreateWebRTCToken": { "type": "object", "required": ["to", "from", "uses"], - "x-web-rtc": true, "additionalProperties": false, "properties": { "to": { @@ -3865,7 +4937,6 @@ "tags": [], "summary": "List applications", "operationId": "list-applications", - "x-is-paginated": true, "parameters": [ { "name": "alias", @@ -3933,7 +5004,6 @@ "tags": [], "summary": "List available numbers", "operationId": "list-available-numbers", - "x-is-paginated": true, "parameters": [ { "name": "phoneNumber", @@ -4119,7 +5189,6 @@ "tags": [], "summary": "List Incoming Numbers", "operationId": "list-incoming-numbers", - "x-is-paginated": true, "parameters": [ { "$ref": "#/components/parameters/AccountId" @@ -4445,7 +5514,6 @@ "tags": [], "summary": "List Calls", "operationId": "list-calls", - "x-is-paginated": true, "parameters": [ { "name": "active", @@ -4550,7 +5618,6 @@ "tags": [], "summary": "List Call Recordings", "operationId": "list-call-recordings", - "x-is-paginated": true, "parameters": [ { "name": "dateCreated", @@ -4594,7 +5661,6 @@ "tags": [], "summary": "List Call Logs", "operationId": "list-call-logs", - "x-is-paginated": true, "parameters": [ { "$ref": "#/components/parameters/AccountId" @@ -4628,7 +5694,6 @@ "post": { "summary": "Make a JWT for WebRTC calling", "operationId": "make-a-webrtc-jwt", - "x-web-rtc": true, "parameters": [ { "$ref": "#/components/parameters/AccountId" @@ -4698,7 +5763,6 @@ "tags": [], "summary": "List Conferences", "operationId": "list-conferences", - "x-is-paginated": true, "parameters": [ { "name": "status", @@ -4957,7 +6021,6 @@ "tags": [], "summary": "List Participants", "operationId": "list-participants", - "x-is-paginated": true, "parameters": [ { "name": "talk", @@ -5019,7 +6082,6 @@ "tags": [], "summary": "List Conference Recordings", "operationId": "list-conference-recordings", - "x-is-paginated": true, "parameters": [ { "name": "callId", @@ -5148,7 +6210,6 @@ "tags": [], "summary": "List Active Queues", "operationId": "list-active-queues", - "x-is-paginated": true, "parameters": [ { "name": "alias", @@ -5282,7 +6343,6 @@ "tags": [], "summary": "List Members", "operationId": "list-members", - "x-is-paginated": true, "parameters": [ { "$ref": "#/components/parameters/AccountId" @@ -5401,7 +6461,6 @@ "tags": [], "summary": "List All Account Logs", "operationId": "list-all-account-logs", - "x-is-paginated": true, "parameters": [ { "$ref": "#/components/parameters/AccountId" @@ -5461,7 +6520,6 @@ "tags": [], "summary": "List Recordings", "operationId": "list-recordings", - "x-is-paginated": true, "parameters": [ { "name": "callId", @@ -5643,7 +6701,6 @@ "tags": [], "summary": "List SMS Messages", "operationId": "list-sms-messages", - "x-is-paginated": true, "parameters": [ { "$ref": "#/components/parameters/AccountId" @@ -5808,8 +6865,7 @@ "get": { "tags": [], "summary": "Get list of SMS 10DLC Campaigns", - "operationId": "get-tenDLC-sms-Campaigns", - "x-is-paginated": true, + "operationId": "get-tenDLC-sms-campaigns", "parameters": [ { "$ref": "#/components/parameters/AccountId" @@ -5922,7 +6978,6 @@ "tags": [], "summary": "Get list of SMS 10DLC Partner Campaigns", "operationId": "get-tenDLC-sms-partnerCampaigns", - "x-is-paginated": true, "parameters": [ { "$ref": "#/components/parameters/AccountId" @@ -6044,7 +7099,6 @@ "tags": [], "summary": "Get list of SMS 10DLC Brands", "operationId": "get-tenDLC-sms-brands", - "x-is-paginated": true, "parameters": [ { "$ref": "#/components/parameters/AccountId" @@ -6146,7 +7200,6 @@ "tags": [], "summary": "Get list of TollFree Campaigns", "operationId": "get-tollFree-sms-campaigns", - "x-is-paginated": true, "parameters": [ { "$ref": "#/components/parameters/AccountId" diff --git a/package.json b/package.json index c6f6aac1..89ae542f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,8 @@ { "dependencies": { - "@stoplight/prism-cli": "5.6.0" + "@stoplight/prism-cli": "5.6.0", + "fast-xml-parser": "^4.5.0", + "jsonpath-plus": "^10.0.0" }, "resolutions": { "@stoplight/json": "3.20.0", diff --git a/spec/api/default_api_spec.rb b/spec/api/default_api_spec.rb index ad3d7e2c..b7ed0520 100644 --- a/spec/api/default_api_spec.rb +++ b/spec/api/default_api_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -35,10 +35,9 @@ Freeclimb::File = Tempfile @api_instance = Freeclimb::DefaultApi.new(@api_client) + @buy_incoming_number_request_buy_a_phone_number_test_value = Freeclimb::BuyIncomingNumberRequest.new({ phone_number: 'phone_number_example' }) - @buy_incoming_number_request_buy_a_phone_number_test_value = Freeclimb::BuyIncomingNumberRequest.new({phone_number: 'phone_number_example'}) - - @create_conference_request_create_a_conference_test_value = Freeclimb::CreateConferenceRequest.new({_alias: 'alias_example', play_beep:Freeclimb::PlayBeep::ALWAYS, record: true, wait_url: 'wait_url_example', status_callback_url: 'status_callback_url_example'}) + @create_conference_request_create_a_conference_test_value = Freeclimb::CreateConferenceRequest.new({ _alias: 'alias_example', play_beep: Freeclimb::PlayBeep::ALWAYS, record: true, wait_url: 'https://wait_url_example.com', status_callback_url: 'https://status_callback_url_example.com' }) @queue_request_create_a_queue_test_value = Freeclimb::QueueRequest.new @@ -58,7 +57,7 @@ @recording_id_download_a_recording_file_test_value = 'recordingId_example' - @filter_logs_request_filter_logs_test_value = Freeclimb::FilterLogsRequest.new({pql: 'pql_example'}) + @filter_logs_request_filter_logs_test_value = Freeclimb::FilterLogsRequest.new({ pql: 'pql_example' }) @call_id_get_a_call_test_value = 'callId_example' @@ -172,7 +171,7 @@ @listen_list_participants_test_value = true - @to_list_sms_messages_test_value='to_example' + @to_list_sms_messages_test_value = 'to_example' @_from_list_sms_messages_test_value = 'from_example' @@ -232,13 +231,13 @@ @application_request_update_an_application_test_value = Freeclimb::ApplicationRequest.new - @make_call_request_make_a_call_test_value = Freeclimb::MakeCallRequest.new({from: 'from_example', to: 'to_example'}) + @make_call_request_make_a_call_test_value = Freeclimb::MakeCallRequest.new({ from: 'from_example', to: 'to_example' }) - @message_request_send_an_sms_message_test_value = Freeclimb::MessageRequest.new({from: 'from_example', to: 'to_example', text: 'text_example'}) + @message_request_send_an_sms_message_test_value = Freeclimb::MessageRequest.new({ from: 'from_example', to: 'to_example', text: 'text_example' }) - @update_conference_request_update_a_conference_test_value = Freeclimb::UpdateConferenceRequest.new({_alias: 'alias_example', play_beep:Freeclimb::PlayBeep::ALWAYS , status: Freeclimb::UpdateConferenceRequestStatus::EMPTY}) + @update_conference_request_update_a_conference_test_value = Freeclimb::UpdateConferenceRequest.new({ _alias: 'alias_example', play_beep: Freeclimb::PlayBeep::ALWAYS, status: Freeclimb::UpdateConferenceRequestStatus::EMPTY }) - @update_call_request_update_a_live_call_test_value = Freeclimb::UpdateCallRequest.new({status: Freeclimb::UpdateCallRequestStatus::CANCELED}) + @update_call_request_update_a_live_call_test_value = Freeclimb::UpdateCallRequest.new({ status: Freeclimb::UpdateCallRequestStatus::CANCELED }) @update_conference_participant_request_update_a_participant_test_value = Freeclimb::UpdateConferenceParticipantRequest.new @@ -250,11 +249,11 @@ @conference_id_list_conference_recordings_test_value = 'conferenceId_example' - @create_web_rtc_token_make_a_webrtc_jwt_test_value=Freeclimb::CreateWebRTCToken.new({to: 'to_example', from: 'from_example', uses: 2}) + @create_web_rtc_token_make_a_webrtc_jwt_test_value = Freeclimb::CreateWebRTCToken.new({ to: 'to_example', from: 'from_example', uses: 2 }) - @knowledge_base_id_create_knowledge_base_completion_test_value= 'knowledgeBaseId_example' + @knowledge_base_id_create_knowledge_base_completion_test_value = 'knowledgeBaseId_example' - @completion_request_create_knowledge_base_completion_test_value=Freeclimb::CompletionRequest.new({query: 'query_example'}) + @completion_request_create_knowledge_base_completion_test_value = Freeclimb::CompletionRequest.new({ query: 'query_example' }) end after do @@ -475,7 +474,7 @@ call_id = @call_id_dequeue_a_member_test_value result = @api_instance.dequeue_a_member( - queue_id,call_id, + queue_id, call_id, { } @@ -621,7 +620,7 @@ call_id = @call_id_get_a_member_test_value result = @api_instance.get_a_member( - queue_id,call_id, + queue_id, call_id, { } @@ -647,7 +646,7 @@ call_id = @call_id_get_a_participant_test_value result = @api_instance.get_a_participant( - conference_id,call_id, + conference_id, call_id, { } @@ -1115,7 +1114,7 @@ result = @api_instance.list_available_numbers( { - :phone_number => phone_number,:region => region,:country => country,:voice_enabled => voice_enabled,:sms_enabled => sms_enabled,:capabilities_voice => capabilities_voice,:capabilities_sms => capabilities_sms,:capabilities_toll_free => capabilities_toll_free,:capabilities_ten_dlc => capabilities_ten_dlc,:capabilities_short_code => capabilities_short_code, + :phone_number => phone_number, :region => region, :country => country, :voice_enabled => voice_enabled, :sms_enabled => sms_enabled, :capabilities_voice => capabilities_voice, :capabilities_sms => capabilities_sms, :capabilities_toll_free => capabilities_toll_free, :capabilities_ten_dlc => capabilities_ten_dlc, :capabilities_short_code => capabilities_short_code, } ) false @@ -1203,7 +1202,7 @@ result = @api_instance.list_calls( { - :active => active,:to => to,:from => from,:status => status,:start_time => start_time,:end_time => end_time,:parent_call_id => parent_call_id,:application_id => application_id, + :active => active, :to => to, :from => from, :status => status, :start_time => start_time, :end_time => end_time, :parent_call_id => parent_call_id, :application_id => application_id, } ) false @@ -1231,7 +1230,7 @@ result = @api_instance.list_conference_recordings( conference_id, { - :call_id => call_id,:date_created => date_created, + :call_id => call_id, :date_created => date_created, } ) false @@ -1261,7 +1260,7 @@ result = @api_instance.list_conferences( { - :status => status,:_alias => _alias,:date_created => date_created,:date_updated => date_updated, + :status => status, :_alias => _alias, :date_created => date_created, :date_updated => date_updated, } ) false @@ -1315,7 +1314,7 @@ result = @api_instance.list_incoming_numbers( { - :phone_number => phone_number,:_alias => _alias,:region => region,:country => country,:application_id => application_id,:has_application => has_application,:voice_enabled => voice_enabled,:sms_enabled => sms_enabled,:has_campaign => has_campaign,:capabilities_voice => capabilities_voice,:capabilities_sms => capabilities_sms,:capabilities_toll_free => capabilities_toll_free,:capabilities_ten_dlc => capabilities_ten_dlc,:capabilities_short_code => capabilities_short_code,:tfn_campaign_id => tfn_campaign_id,:offnet => offnet, + :phone_number => phone_number, :_alias => _alias, :region => region, :country => country, :application_id => application_id, :has_application => has_application, :voice_enabled => voice_enabled, :sms_enabled => sms_enabled, :has_campaign => has_campaign, :capabilities_voice => capabilities_voice, :capabilities_sms => capabilities_sms, :capabilities_toll_free => capabilities_toll_free, :capabilities_ten_dlc => capabilities_ten_dlc, :capabilities_short_code => capabilities_short_code, :tfn_campaign_id => tfn_campaign_id, :offnet => offnet, } ) false @@ -1356,6 +1355,7 @@ # @param [Hash] opts the optional parameters # @option opts [Boolean] :talk Only show Participants with the talk privilege. # @option opts [Boolean] :listen Only show Participants with the listen privilege. + # @option opts [Boolean] :dtmf_pass_through Only show Participants with the dtmfPassThrough privilege. # @return [ConferenceParticipantList] describe 'list_participants test' do it 'should work' do @@ -1363,11 +1363,12 @@ conference_id = @conference_id_list_participants_test_value talk = @talk_list_participants_test_value listen = @listen_list_participants_test_value + dtmf_pass_through = @dtmf_pass_through_list_participants_test_value result = @api_instance.list_participants( conference_id, { - :talk => talk,:listen => listen, + :talk => talk, :listen => listen, :dtmf_pass_through => dtmf_pass_through, } ) false @@ -1395,7 +1396,7 @@ result = @api_instance.list_recordings( { - :call_id => call_id,:conference_id => conference_id,:date_created => date_created, + :call_id => call_id, :conference_id => conference_id, :date_created => date_created, } ) false @@ -1433,7 +1434,7 @@ result = @api_instance.list_sms_messages( { - :to => to,:from => from,:begin_time => begin_time,:end_time => end_time,:direction => direction,:campaign_id => campaign_id,:brand_id => brand_id,:is10_dlc => is10_dlc, + :to => to, :from => from, :begin_time => begin_time, :end_time => end_time, :direction => direction, :campaign_id => campaign_id, :brand_id => brand_id, :is10_dlc => is10_dlc, } ) false @@ -1505,7 +1506,7 @@ call_id = @call_id_remove_a_participant_test_value result = @api_instance.remove_a_participant( - conference_id,call_id, + conference_id, call_id, { } @@ -1605,7 +1606,7 @@ update_call_request = @update_call_request_update_a_live_call_test_value result = @api_instance.update_a_live_call( - call_id,update_call_request, + call_id, update_call_request, { } @@ -1633,7 +1634,7 @@ update_conference_participant_request = @update_conference_participant_request_update_a_participant_test_value result = @api_instance.update_a_participant( - conference_id,call_id, + conference_id, call_id, { :update_conference_participant_request => update_conference_participant_request, } @@ -1748,6 +1749,29 @@ end end + # unit tests for get_next_page filter_logs + # Filter Logs + # @param filter_logs_request Filter logs request paramters + # @param [Hash] opts the optional parameters + # @return [LogList] + describe 'filter_logs_get_next_page test' do + it 'should work' do + + filter_logs_request = @filter_logs_request_filter_logs_test_value + + result = @api_instance.filter_logs( + filter_logs_request, + { + + } + ) + result.next_page_uri = "/Accounts/{accountId}/Logs?cursor=1" + next_page_result = @api_instance.get_next_page(result) + expect(next_page_result).to be_a Freeclimb::LogList + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for get_next_page get_ten_dlc_sms_brands # Get list of SMS 10DLC Brands # @param [Hash] opts the optional parameters @@ -1934,7 +1958,7 @@ result = @api_instance.list_available_numbers( { - :phone_number => phone_number,:region => region,:country => country,:voice_enabled => voice_enabled,:sms_enabled => sms_enabled,:capabilities_voice => capabilities_voice,:capabilities_sms => capabilities_sms,:capabilities_toll_free => capabilities_toll_free,:capabilities_ten_dlc => capabilities_ten_dlc,:capabilities_short_code => capabilities_short_code, + :phone_number => phone_number, :region => region, :country => country, :voice_enabled => voice_enabled, :sms_enabled => sms_enabled, :capabilities_voice => capabilities_voice, :capabilities_sms => capabilities_sms, :capabilities_toll_free => capabilities_toll_free, :capabilities_ten_dlc => capabilities_ten_dlc, :capabilities_short_code => capabilities_short_code, } ) result.next_page_uri = "/AvailablePhoneNumbers?cursor=1" @@ -2019,7 +2043,7 @@ result = @api_instance.list_calls( { - :active => active,:to => to,:from => from,:status => status,:start_time => start_time,:end_time => end_time,:parent_call_id => parent_call_id,:application_id => application_id, + :active => active, :to => to, :from => from, :status => status, :start_time => start_time, :end_time => end_time, :parent_call_id => parent_call_id, :application_id => application_id, } ) result.next_page_uri = "/Accounts/{accountId}/Calls?cursor=1" @@ -2046,7 +2070,7 @@ result = @api_instance.list_conference_recordings( conference_id, { - :call_id => call_id,:date_created => date_created, + :call_id => call_id, :date_created => date_created, } ) result.next_page_uri = "/Accounts/{accountId}/Conferences/{conferenceId}/Recordings?cursor=1" @@ -2075,7 +2099,7 @@ result = @api_instance.list_conferences( { - :status => status,:_alias => _alias,:date_created => date_created,:date_updated => date_updated, + :status => status, :_alias => _alias, :date_created => date_created, :date_updated => date_updated, } ) result.next_page_uri = "/Accounts/{accountId}/Conferences?cursor=1" @@ -2128,7 +2152,7 @@ result = @api_instance.list_incoming_numbers( { - :phone_number => phone_number,:_alias => _alias,:region => region,:country => country,:application_id => application_id,:has_application => has_application,:voice_enabled => voice_enabled,:sms_enabled => sms_enabled,:has_campaign => has_campaign,:capabilities_voice => capabilities_voice,:capabilities_sms => capabilities_sms,:capabilities_toll_free => capabilities_toll_free,:capabilities_ten_dlc => capabilities_ten_dlc,:capabilities_short_code => capabilities_short_code,:tfn_campaign_id => tfn_campaign_id,:offnet => offnet, + :phone_number => phone_number, :_alias => _alias, :region => region, :country => country, :application_id => application_id, :has_application => has_application, :voice_enabled => voice_enabled, :sms_enabled => sms_enabled, :has_campaign => has_campaign, :capabilities_voice => capabilities_voice, :capabilities_sms => capabilities_sms, :capabilities_toll_free => capabilities_toll_free, :capabilities_ten_dlc => capabilities_ten_dlc, :capabilities_short_code => capabilities_short_code, :tfn_campaign_id => tfn_campaign_id, :offnet => offnet, } ) result.next_page_uri = "/Accounts/{accountId}/IncomingPhoneNumbers?cursor=1" @@ -2167,6 +2191,7 @@ # @param [Hash] opts the optional parameters # @option opts [Boolean] :talk Only show Participants with the talk privilege. # @option opts [Boolean] :listen Only show Participants with the listen privilege. + # @option opts [Boolean] :dtmf_pass_through Only show Participants with the dtmfPassThrough privilege. # @return [ConferenceParticipantList] describe 'list_participants_get_next_page test' do it 'should work' do @@ -2174,11 +2199,12 @@ conference_id = @conference_id_list_participants_test_value talk = @talk_list_participants_test_value listen = @listen_list_participants_test_value + dtmf_pass_through = @dtmf_pass_through_list_participants_test_value result = @api_instance.list_participants( conference_id, { - :talk => talk,:listen => listen, + :talk => talk, :listen => listen, :dtmf_pass_through => dtmf_pass_through, } ) result.next_page_uri = "/Accounts/{accountId}/Conferences/{conferenceId}/Participants?cursor=1" @@ -2205,7 +2231,7 @@ result = @api_instance.list_recordings( { - :call_id => call_id,:conference_id => conference_id,:date_created => date_created, + :call_id => call_id, :conference_id => conference_id, :date_created => date_created, } ) result.next_page_uri = "/Accounts/{accountId}/Recordings?cursor=1" @@ -2242,7 +2268,7 @@ result = @api_instance.list_sms_messages( { - :to => to,:from => from,:begin_time => begin_time,:end_time => end_time,:direction => direction,:campaign_id => campaign_id,:brand_id => brand_id,:is10_dlc => is10_dlc, + :to => to, :from => from, :begin_time => begin_time, :end_time => end_time, :direction => direction, :campaign_id => campaign_id, :brand_id => brand_id, :is10_dlc => is10_dlc, } ) result.next_page_uri = "/Accounts/{accountId}/Messages?cursor=1" diff --git a/spec/factories.rb b/spec/factories.rb index d9c27cdf..5e0f71d7 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -1,80 +1,80 @@ FactoryBot.define do - factory :buy_incoming_number_request, class: Freeclimb::BuyIncomingNumberRequest do - phone_number { "1234567890" } - _alias { "TEST_ALIAS" } - application_id { "TEST_APPLICATION_ID" } - end - factory :create_conference_request, class: Freeclimb::CreateConferenceRequest do - _alias { "TEST_ALIAS" } - play_beep { "always" } - record { true } - wait_url { "TEST_WAIT_URL" } - status_callback_url { "TEST_STATUS_CALLBACK_URL" } - end - factory :queue_request, class: Freeclimb::QueueRequest do - _alias { "TEST_ALIAS" } - max_size { 100 } - end - factory :application_request, class: Freeclimb::ApplicationRequest do - _alias { "TEST_ALIAS "} - voice_url { "TEST_VOICE_URL" } - voice_fallback_url { "TEST_VOICE_FALLBACK_URL" } - call_connect_url { "TEST_CALL_CONNECT_URL" } - status_callback_url { "TEST_STATUS_CALLBACK_URL" } - sms_url { "TEST_SMS_URL" } - sms_fallback_url { "TEST_SMS_FALLBACK_URL" } - end - factory :filter_logs_request, class: Freeclimb::FilterLogsRequest do - pql { "TEST_PQL" } - end - factory :capabilities, class: Freeclimb::Capabilities do - voice { true } - sms { true } - toll_free { false } - ten_dlc { false } - short_code { false } - end - factory :make_call_request, class: Freeclimb::MakeCallRequest do - from { "TEST_FROM" } - to { "TEST_TO" } - application_id { "TEST_APPLICATION_ID" } - send_digits { "TEST_SEND_DIGITS" } - if_machine { "TEST_IF_MACHINE" } - if_machine_url { "TEST_IF_MACHINE_URL" } - timeout { 120 } - parent_call_id { "TEST_PARENT_CALL_ID" } - privacy_mode { false } - call_connect_url { "TEST_CALL_CONNECT_URL" } - end - factory :message_request, class: Freeclimb::MessageRequest do - uri { "TEST_URI" } - date_created { "TEST_DATE_CREATED" } - date_updated { "TEST_DATE_UPDATED" } - revision { "TEST_REVISION" } - from { "TEST_FROM" } - to { "TEST_TO" } - text { "TEST_TEXT" } - notification_url { "TEST_NOTIFICATION_URL" } - account_id { "TEST_ACCOUNT_ID" } - end - factory :update_conference_participant_request, class: Freeclimb::UpdateConferenceParticipantRequest do - talk { true } - listen { true } - end - factory :account_request, class: Freeclimb::AccountRequest do - _alias { "TEST_ALIAS" } - label { "TEST_LABEL" } - end - factory :incoming_number_request, class: Freeclimb::IncomingNumberRequest do - application_id { "TEST_APPLICATION_ID" } - _alias { "TEST_ALIAS" } - end - factory :update_conference_request, class: Freeclimb::UpdateConferenceRequest do - _alias { "TEST_ALIAS" } - play_beep { "always" } - status { "empty" } - end - factory :update_call_request, class: Freeclimb::UpdateCallRequest do - status { "completed" } - end + factory :buy_incoming_number_request, class: Freeclimb::BuyIncomingNumberRequest do + phone_number { "1234567890" } + _alias { "TEST_ALIAS" } + application_id { "TEST_APPLICATION_ID" } + end + factory :create_conference_request, class: Freeclimb::CreateConferenceRequest do + _alias { "TEST_ALIAS" } + play_beep { "always" } + record { true } + wait_url { "TEST_WAIT_URL" } + status_callback_url { "TEST_STATUS_CALLBACK_URL" } + end + factory :queue_request, class: Freeclimb::QueueRequest do + _alias { "TEST_ALIAS" } + max_size { 100 } + end + factory :application_request, class: Freeclimb::ApplicationRequest do + _alias { "TEST_ALIAS " } + voice_url { "TEST_VOICE_URL" } + voice_fallback_url { "TEST_VOICE_FALLBACK_URL" } + call_connect_url { "TEST_CALL_CONNECT_URL" } + status_callback_url { "TEST_STATUS_CALLBACK_URL" } + sms_url { "TEST_SMS_URL" } + sms_fallback_url { "TEST_SMS_FALLBACK_URL" } + end + factory :filter_logs_request, class: Freeclimb::FilterLogsRequest do + pql { "TEST_PQL" } + end + factory :capabilities, class: Freeclimb::Capabilities do + voice { true } + sms { true } + toll_free { false } + ten_dlc { false } + short_code { false } + end + factory :make_call_request, class: Freeclimb::MakeCallRequest do + from { "TEST_FROM" } + to { "TEST_TO" } + application_id { "TEST_APPLICATION_ID" } + send_digits { "TEST_SEND_DIGITS" } + if_machine { "TEST_IF_MACHINE" } + if_machine_url { "TEST_IF_MACHINE_URL" } + timeout { 120 } + parent_call_id { "TEST_PARENT_CALL_ID" } + privacy_mode { false } + call_connect_url { "TEST_CALL_CONNECT_URL" } + end + factory :message_request, class: Freeclimb::MessageRequest do + uri { "TEST_URI" } + date_created { "TEST_DATE_CREATED" } + date_updated { "TEST_DATE_UPDATED" } + revision { "TEST_REVISION" } + from { "TEST_FROM" } + to { "TEST_TO" } + text { "TEST_TEXT" } + notification_url { "TEST_NOTIFICATION_URL" } + account_id { "TEST_ACCOUNT_ID" } + end + factory :update_conference_participant_request, class: Freeclimb::UpdateConferenceParticipantRequest do + talk { true } + listen { true } + end + factory :account_request, class: Freeclimb::AccountRequest do + _alias { "TEST_ALIAS" } + label { "TEST_LABEL" } + end + factory :incoming_number_request, class: Freeclimb::IncomingNumberRequest do + application_id { "TEST_APPLICATION_ID" } + _alias { "TEST_ALIAS" } + end + factory :update_conference_request, class: Freeclimb::UpdateConferenceRequest do + _alias { "TEST_ALIAS" } + play_beep { "always" } + status { "empty" } + end + factory :update_call_request, class: Freeclimb::UpdateCallRequest do + status { "completed" } + end end diff --git a/spec/models/account_request_spec.rb b/spec/models/account_request_spec.rb index 724176e5..26cbb4dc 100644 --- a/spec/models/account_request_spec.rb +++ b/spec/models/account_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -44,24 +44,30 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::AccountRequest.new( - _alias: "TS", - label: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::AccountRequest.new( + _alias: "TS", + + label: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::AccountRequest' do - expect{instance = Freeclimb::AccountRequest.new( - _alias: "TS", - label: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::AccountRequest.new( + _alias: "TS", + + label: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::AccountRequest.new( - _alias: "TS", - label: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::AccountRequest.new( + _alias: "TS", + + label: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -69,7 +75,9 @@ it 'checks if properties are valid' do instance = Freeclimb::AccountRequest.new( _alias: "TS", + label: "TS", + ) expect(instance.valid?).to eq(true) end @@ -89,11 +97,15 @@ obj = Object.new() instance_1 = Freeclimb::AccountRequest.new( _alias: "TS", + label: "TS", + ) instance_2 = Freeclimb::AccountRequest.new( _alias: "TS", + label: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -101,11 +113,15 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::AccountRequest.new( _alias: "TS", + label: "TS", + ) instance_2 = Freeclimb::AccountRequest.new( _alias: "ST", + label: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -115,9 +131,11 @@ it 'calculates hash code' do instance = Freeclimb::AccountRequest.new( _alias: "TS", + label: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -125,9 +143,17 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::AccountRequest.new( _alias: "TS", + label: "TS", + + ) + instance_2 = Freeclimb::AccountRequest.new( + _alias: "TS", + + label: "TS", + ) - instance_2 = Freeclimb::AccountRequest.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -135,7 +161,9 @@ describe 'test method "_deserialize"' do instance = Freeclimb::AccountRequest.new( _alias: "TS", + label: "TS", + ) it 'deserializes the data of _alias' do expect(instance._deserialize("String", instance._alias)).to be_a_kind_of(String) @@ -149,7 +177,9 @@ it 'returns the string representation of the object' do instance = Freeclimb::AccountRequest.new( _alias: "TS", + label: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -159,7 +189,9 @@ it 'returns the object in the form of hash' do instance = Freeclimb::AccountRequest.new( _alias: "TS", + label: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -167,11 +199,15 @@ obj = Object.new() instance_1 = Freeclimb::AccountRequest.new( _alias: "TS", + label: "TS", + ) instance_2 = Freeclimb::AccountRequest.new( _alias: "TS", + label: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -180,8 +216,10 @@ describe 'test method "_to_hash"' do instance = Freeclimb::AccountRequest.new( _alias: "TS", + label: "TS", + ) it 'returns _alias in the form of hash' do expect(instance._to_hash(instance._alias)).to eq(instance._alias) diff --git a/spec/models/account_result_spec.rb b/spec/models/account_result_spec.rb index 3b6aca8a..a8f1f0fc 100644 --- a/spec/models/account_result_spec.rb +++ b/spec/models/account_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,7 +104,6 @@ end end - describe 'test attribute "status"' do it 'assigns value CLOSED' do instance.status = Freeclimb::AccountStatus::CLOSED @@ -119,7 +118,6 @@ expect(instance.status).to eq(Freeclimb::AccountStatus::ACTIVE) end end - describe 'test attribute "subresource_uris"' do it 'should work' do @@ -131,51 +129,90 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::AccountResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - account_id: "TS", - api_key: "TS", - _alias: "TS", - label: "TS", - type: "TRIAL", - status: "CLOSED", - subresource_uris: Object.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::AccountResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + api_key: "TS", + + _alias: "TS", + + label: "TS", + + + type: Freeclimb::AccountType::TRIAL, + + + status: Freeclimb::AccountStatus::CLOSED, + + subresource_uris: Object.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::AccountResult' do - expect{instance = Freeclimb::AccountResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - account_id: "TS", - api_key: "TS", - _alias: "TS", - label: "TS", - type: "TRIAL", - status: "CLOSED", - subresource_uris: Object.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::AccountResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + api_key: "TS", + + _alias: "TS", + + label: "TS", + + + type: Freeclimb::AccountType::TRIAL, + + + status: Freeclimb::AccountStatus::CLOSED, + + subresource_uris: Object.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::AccountResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - account_id: "TS", - api_key: "TS", - _alias: "TS", - label: "TS", - type: "TRIAL", - status: "CLOSED", - subresource_uris: Object.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::AccountResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + api_key: "TS", + + _alias: "TS", + + label: "TS", + + + type: Freeclimb::AccountType::TRIAL, + + + status: Freeclimb::AccountStatus::CLOSED, + + subresource_uris: Object.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -183,16 +220,29 @@ it 'checks if properties are valid' do instance = Freeclimb::AccountResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + api_key: "TS", + _alias: "TS", + label: "TS", - type: "TRIAL", - status: "CLOSED", + + + type: Freeclimb::AccountType::TRIAL, + + + status: Freeclimb::AccountStatus::CLOSED, + subresource_uris: Object.new(), + ) expect(instance.valid?).to eq(true) end @@ -212,33 +262,55 @@ obj = Object.new() instance_1 = Freeclimb::AccountResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + api_key: "TS", + _alias: "TS", + label: "TS", - type: Freeclimb::AccountType.new(), - type: "TRIAL", - status: Freeclimb::AccountStatus.new(), - status: "CLOSED", + + + type: Freeclimb::AccountType::TRIAL, + + + status: Freeclimb::AccountStatus::CLOSED, + subresource_uris: obj, + ) instance_2 = Freeclimb::AccountResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + api_key: "TS", + _alias: "TS", + label: "TS", - type: Freeclimb::AccountType.new(), - type: "TRIAL", - status: Freeclimb::AccountStatus.new(), - status: "CLOSED", + + + type: Freeclimb::AccountType::TRIAL, + + + status: Freeclimb::AccountStatus::CLOSED, + subresource_uris: obj, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -246,33 +318,55 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::AccountResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 2, + account_id: "TS", + api_key: "TS", + _alias: "TS", + label: "TS", - type: Freeclimb::AccountType.new(), - type: "TRIAL", - status: Freeclimb::AccountStatus.new(), - status: "CLOSED", + + + type: Freeclimb::AccountType::TRIAL, + + + status: Freeclimb::AccountStatus::CLOSED, + subresource_uris: Object.new(), + ) instance_2 = Freeclimb::AccountResult.new( uri: "ST", + date_created: "ST", + date_updated: "ST", + revision: 1, + account_id: "ST", + api_key: "ST", + _alias: "ST", + label: "ST", - type: Freeclimb::AccountType.new(), - type: "FULL", - status: Freeclimb::AccountStatus.new(), - status: "SUSPENDED", + + + type: nil, + + + status: nil, + subresource_uris: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -282,18 +376,31 @@ it 'calculates hash code' do instance = Freeclimb::AccountResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + api_key: "TS", + _alias: "TS", + label: "TS", - type: "TRIAL", - status: "CLOSED", + + + type: Freeclimb::AccountType::TRIAL, + + + status: Freeclimb::AccountStatus::CLOSED, + subresource_uris: Object.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -301,18 +408,57 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::AccountResult.new( uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + api_key: "TS", + + _alias: "TS", + + label: "TS", + + + type: Freeclimb::AccountType::TRIAL, + + + status: Freeclimb::AccountStatus::CLOSED, + + subresource_uris: Object.new(), + + ) + instance_2 = Freeclimb::AccountResult.new( + uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + api_key: "TS", + _alias: "TS", + label: "TS", - type: "TRIAL", - status: "CLOSED", + + + type: Freeclimb::AccountType::TRIAL, + + + status: Freeclimb::AccountStatus::CLOSED, + subresource_uris: Object.new(), + ) - instance_2 = Freeclimb::AccountResult.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -320,16 +466,29 @@ describe 'test method "_deserialize"' do instance = Freeclimb::AccountResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + api_key: "TS", + _alias: "TS", + label: "TS", - type: "TRIAL", - status: "CLOSED", + + + type: Freeclimb::AccountType::TRIAL, + + + status: Freeclimb::AccountStatus::CLOSED, + subresource_uris: Object.new(), + ) it 'deserializes the data of uri' do expect(instance._deserialize("String", instance.uri)).to be_a_kind_of(String) @@ -364,16 +523,29 @@ it 'returns the string representation of the object' do instance = Freeclimb::AccountResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + api_key: "TS", + _alias: "TS", + label: "TS", - type: "TRIAL", - status: "CLOSED", + + + type: Freeclimb::AccountType::TRIAL, + + + status: Freeclimb::AccountStatus::CLOSED, + subresource_uris: Object.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -383,16 +555,29 @@ it 'returns the object in the form of hash' do instance = Freeclimb::AccountResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + api_key: "TS", + _alias: "TS", + label: "TS", - type: "TRIAL", - status: "CLOSED", + + + type: Freeclimb::AccountType::TRIAL, + + + status: Freeclimb::AccountStatus::CLOSED, + subresource_uris: Object.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -400,29 +585,55 @@ obj = Object.new() instance_1 = Freeclimb::AccountResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + api_key: "TS", + _alias: "TS", + label: "TS", - type: "TRIAL", - status: "CLOSED", + + + type: Freeclimb::AccountType::TRIAL, + + + status: Freeclimb::AccountStatus::CLOSED, + subresource_uris: obj, + ) instance_2 = Freeclimb::AccountResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + api_key: "TS", + _alias: "TS", + label: "TS", - type: "TRIAL", - status: "CLOSED", + + + type: Freeclimb::AccountType::TRIAL, + + + status: Freeclimb::AccountStatus::CLOSED, + subresource_uris: obj, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -431,26 +642,39 @@ describe 'test method "_to_hash"' do instance = Freeclimb::AccountResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + api_key: "TS", + _alias: "TS", + label: "TS", + - type: "TRIAL", + + type: Freeclimb::AccountType::TRIAL, + - status: "CLOSED", + + status: Freeclimb::AccountStatus::CLOSED, + subresource_uris: Object.new(), + ) it 'returns uri in the form of hash' do expect(instance._to_hash(instance.uri)).to eq(instance.uri) diff --git a/spec/models/account_status_spec.rb b/spec/models/account_status_spec.rb index 933b3fc2..db23c8a4 100644 --- a/spec/models/account_status_spec.rb +++ b/spec/models/account_status_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/account_type_spec.rb b/spec/models/account_type_spec.rb index de381b1a..86830420 100644 --- a/spec/models/account_type_spec.rb +++ b/spec/models/account_type_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/add_to_conference_notification_webhook_spec.rb b/spec/models/add_to_conference_notification_webhook_spec.rb new file mode 100644 index 00000000..aedd2237 --- /dev/null +++ b/spec/models/add_to_conference_notification_webhook_spec.rb @@ -0,0 +1,866 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::AddToConferenceNotificationWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::AddToConferenceNotificationWebhook do + let(:instance) { Freeclimb::AddToConferenceNotificationWebhook.new } + + describe 'test an instance of AddToConferenceNotificationWebhook' do + it 'should create an instance of AddToConferenceNotificationWebhook' do + expect(instance).to be_instance_of(Freeclimb::AddToConferenceNotificationWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of AddToConferenceNotificationWebhook' do + payload = '{ "requestType": "addToConferenceNotification" }' + expect(Freeclimb::AddToConferenceNotificationWebhook.deserialize(payload)).to be_instance_of(Freeclimb::AddToConferenceNotificationWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "status"' do + it 'assigns value EMPTY' do + instance.status = Freeclimb::ConferenceStatus::EMPTY + expect(instance.status).to eq(Freeclimb::ConferenceStatus::EMPTY) + end + it 'assigns value POPULATED' do + instance.status = Freeclimb::ConferenceStatus::POPULATED + expect(instance.status).to eq(Freeclimb::ConferenceStatus::POPULATED) + end + it 'assigns value IN_PROGRESS' do + instance.status = Freeclimb::ConferenceStatus::IN_PROGRESS + expect(instance.status).to eq(Freeclimb::ConferenceStatus::IN_PROGRESS) + end + it 'assigns value TERMINATED' do + instance.status = Freeclimb::ConferenceStatus::TERMINATED + expect(instance.status).to eq(Freeclimb::ConferenceStatus::TERMINATED) + end + end + describe 'test attribute "recording_url"' do + it 'should work' do + instance.recording_url = "TEST_STRING" + expect(instance.recording_url).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_id"' do + it 'should work' do + instance.recording_id = "TEST_STRING" + expect(instance.recording_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_duration_sec"' do + it 'should work' do + + + instance.recording_duration_sec = 1 + expect(instance.recording_duration_sec).to eq(1) + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::AddToConferenceNotificationWebhook' do + expect { instance = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::AddToConferenceNotificationWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + instance_2 = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 2, + + ) + instance_2 = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "ST", + + call_id: "ST", + + account_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + + status: nil, + + recording_url: "ST", + + recording_id: "ST", + + recording_duration_sec: 1, + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + instance_2 = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_url' do + expect(instance._deserialize("String", instance.recording_url)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_id' do + expect(instance._deserialize("String", instance.recording_id)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_duration_sec' do + expect(instance._deserialize("Integer", instance.recording_duration_sec)).to be_a_kind_of(Integer) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + instance_2 = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::AddToConferenceNotificationWebhook.new( + request_type: "TS", + + + call_id: "TS", + + + account_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + + + status: Freeclimb::ConferenceStatus::EMPTY, + + + recording_url: "TS", + + + recording_id: "TS", + + + recording_duration_sec: 1, + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + it 'returns status in the form of hash' do + expect(instance._to_hash(instance.status)).to eq(instance.status) + end + it 'returns recording_url in the form of hash' do + expect(instance._to_hash(instance.recording_url)).to eq(instance.recording_url) + end + it 'returns recording_id in the form of hash' do + expect(instance._to_hash(instance.recording_id)).to eq(instance.recording_id) + end + it 'returns recording_duration_sec in the form of hash' do + expect(instance._to_hash(instance.recording_duration_sec)).to eq(instance.recording_duration_sec) + end + end + +end diff --git a/spec/models/add_to_conference_spec.rb b/spec/models/add_to_conference_spec.rb index bc67a108..f831e796 100644 --- a/spec/models/add_to_conference_spec.rb +++ b/spec/models/add_to_conference_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -98,47 +98,88 @@ end end + describe 'test attribute "dtmf_pass_through"' do + it 'should work' do + instance.dtmf_pass_through = false + expect(instance.dtmf_pass_through).to eq(false) + + end + end + describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::AddToConference.new( - allow_call_control: true, - call_control_sequence: "TS", - call_control_url: "TS", - conference_id: "TS", - leave_conference_url: "TS", - listen: true, - notification_url: "TS", - start_conf_on_enter: true, - talk: true, - )}.not_to raise_error() + expect { instance = Freeclimb::AddToConference.new( + allow_call_control: true, + + call_control_sequence: "TS", + + call_control_url: "TS", + + conference_id: "TS", + + leave_conference_url: "TS", + + listen: true, + + notification_url: "TS", + + start_conf_on_enter: true, + + talk: true, + + dtmf_pass_through: true, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::AddToConference' do - expect{instance = Freeclimb::AddToConference.new( - allow_call_control: true, - call_control_sequence: "TS", - call_control_url: "TS", - conference_id: "TS", - leave_conference_url: "TS", - listen: true, - notification_url: "TS", - start_conf_on_enter: true, - talk: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::AddToConference.new( + allow_call_control: true, + + call_control_sequence: "TS", + + call_control_url: "TS", + + conference_id: "TS", + + leave_conference_url: "TS", + + listen: true, + + notification_url: "TS", + + start_conf_on_enter: true, + + talk: true, + + dtmf_pass_through: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::AddToConference.new( - allow_call_control: true, - call_control_sequence: "TS", - call_control_url: "TS", - conference_id: "TS", - leave_conference_url: "TS", - listen: true, - notification_url: "TS", - start_conf_on_enter: true, - talk: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::AddToConference.new( + allow_call_control: true, + + call_control_sequence: "TS", + + call_control_url: "TS", + + conference_id: "TS", + + leave_conference_url: "TS", + + listen: true, + + notification_url: "TS", + + start_conf_on_enter: true, + + talk: true, + + dtmf_pass_through: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -146,14 +187,25 @@ it 'checks if properties are valid' do instance = Freeclimb::AddToConference.new( allow_call_control: true, + call_control_sequence: "TS", + call_control_url: "TS", + conference_id: "TS", + leave_conference_url: "TS", + listen: true, + notification_url: "TS", + start_conf_on_enter: true, + talk: true, + + dtmf_pass_through: true, + ) expect(instance.valid?).to eq(true) end @@ -173,25 +225,47 @@ obj = Object.new() instance_1 = Freeclimb::AddToConference.new( allow_call_control: true, + call_control_sequence: "TS", + call_control_url: "TS", + conference_id: "TS", + leave_conference_url: "TS", + listen: true, + notification_url: "TS", + start_conf_on_enter: true, + talk: true, + + dtmf_pass_through: true, + ) instance_2 = Freeclimb::AddToConference.new( allow_call_control: true, + call_control_sequence: "TS", + call_control_url: "TS", + conference_id: "TS", + leave_conference_url: "TS", + listen: true, + notification_url: "TS", + start_conf_on_enter: true, + talk: true, + + dtmf_pass_through: true, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,25 +273,47 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::AddToConference.new( allow_call_control: true, + call_control_sequence: "TS", + call_control_url: "TS", + conference_id: "TS", + leave_conference_url: "TS", + listen: true, + notification_url: "TS", + start_conf_on_enter: true, + talk: true, + + dtmf_pass_through: true, + ) instance_2 = Freeclimb::AddToConference.new( allow_call_control: false, + call_control_sequence: "ST", + call_control_url: "ST", + conference_id: "ST", + leave_conference_url: "ST", + listen: false, + notification_url: "ST", + start_conf_on_enter: false, + talk: false, + + dtmf_pass_through: false, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -227,16 +323,27 @@ it 'calculates hash code' do instance = Freeclimb::AddToConference.new( allow_call_control: true, + call_control_sequence: "TS", + call_control_url: "TS", + conference_id: "TS", + leave_conference_url: "TS", + listen: true, + notification_url: "TS", + start_conf_on_enter: true, + talk: true, + + dtmf_pass_through: true, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -244,16 +351,49 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::AddToConference.new( allow_call_control: true, + call_control_sequence: "TS", + call_control_url: "TS", + conference_id: "TS", + leave_conference_url: "TS", + listen: true, + notification_url: "TS", + start_conf_on_enter: true, + talk: true, + + dtmf_pass_through: true, + ) - instance_2 = Freeclimb::AddToConference.new + instance_2 = Freeclimb::AddToConference.new( + allow_call_control: true, + + call_control_sequence: "TS", + + call_control_url: "TS", + + conference_id: "TS", + + leave_conference_url: "TS", + + listen: true, + + notification_url: "TS", + + start_conf_on_enter: true, + + talk: true, + + dtmf_pass_through: true, + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -261,14 +401,25 @@ describe 'test method "_deserialize"' do instance = Freeclimb::AddToConference.new( allow_call_control: true, + call_control_sequence: "TS", + call_control_url: "TS", + conference_id: "TS", + leave_conference_url: "TS", + listen: true, + notification_url: "TS", + start_conf_on_enter: true, + talk: true, + + dtmf_pass_through: true, + ) it 'deserializes the data of allow_call_control' do expect(instance._deserialize("Boolean", instance.allow_call_control)).to be_a_kind_of(TrueClass) @@ -297,20 +448,34 @@ it 'deserializes the data of talk' do expect(instance._deserialize("Boolean", instance.talk)).to be_a_kind_of(TrueClass) end + it 'deserializes the data of dtmf_pass_through' do + expect(instance._deserialize("Boolean", instance.dtmf_pass_through)).to be_a_kind_of(TrueClass) + end end describe 'test method "to_s"' do it 'returns the string representation of the object' do instance = Freeclimb::AddToConference.new( allow_call_control: true, + call_control_sequence: "TS", + call_control_url: "TS", + conference_id: "TS", + leave_conference_url: "TS", + listen: true, + notification_url: "TS", + start_conf_on_enter: true, + talk: true, + + dtmf_pass_through: true, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -320,14 +485,25 @@ it 'returns the object in the form of hash' do instance = Freeclimb::AddToConference.new( allow_call_control: true, + call_control_sequence: "TS", + call_control_url: "TS", + conference_id: "TS", + leave_conference_url: "TS", + listen: true, + notification_url: "TS", + start_conf_on_enter: true, + talk: true, + + dtmf_pass_through: true, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -335,25 +511,47 @@ obj = Object.new() instance_1 = Freeclimb::AddToConference.new( allow_call_control: true, + call_control_sequence: "TS", + call_control_url: "TS", + conference_id: "TS", + leave_conference_url: "TS", + listen: true, + notification_url: "TS", + start_conf_on_enter: true, + talk: true, + + dtmf_pass_through: true, + ) instance_2 = Freeclimb::AddToConference.new( allow_call_control: true, + call_control_sequence: "TS", + call_control_url: "TS", + conference_id: "TS", + leave_conference_url: "TS", + listen: true, + notification_url: "TS", + start_conf_on_enter: true, + talk: true, + + dtmf_pass_through: true, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -362,22 +560,34 @@ describe 'test method "_to_hash"' do instance = Freeclimb::AddToConference.new( allow_call_control: true, + call_control_sequence: "TS", + call_control_url: "TS", + conference_id: "TS", + leave_conference_url: "TS", + listen: true, + notification_url: "TS", + start_conf_on_enter: true, + talk: true, + + + dtmf_pass_through: true, + ) it 'returns allow_call_control in the form of hash' do expect(instance._to_hash(instance.allow_call_control)).to eq(instance.allow_call_control) @@ -406,6 +616,9 @@ it 'returns talk in the form of hash' do expect(instance._to_hash(instance.talk)).to eq(instance.talk) end + it 'returns dtmf_pass_through in the form of hash' do + expect(instance._to_hash(instance.dtmf_pass_through)).to eq(instance.dtmf_pass_through) + end end end diff --git a/spec/models/add_to_queue_notification_webhook_spec.rb b/spec/models/add_to_queue_notification_webhook_spec.rb new file mode 100644 index 00000000..f6db95e4 --- /dev/null +++ b/spec/models/add_to_queue_notification_webhook_spec.rb @@ -0,0 +1,643 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::AddToQueueNotificationWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::AddToQueueNotificationWebhook do + let(:instance) { Freeclimb::AddToQueueNotificationWebhook.new } + + describe 'test an instance of AddToQueueNotificationWebhook' do + it 'should create an instance of AddToQueueNotificationWebhook' do + expect(instance).to be_instance_of(Freeclimb::AddToQueueNotificationWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of AddToQueueNotificationWebhook' do + payload = '{ "requestType": "addToQueueNotification" }' + expect(Freeclimb::AddToQueueNotificationWebhook.deserialize(payload)).to be_instance_of(Freeclimb::AddToQueueNotificationWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::AddToQueueNotificationWebhook' do + expect { instance = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::AddToQueueNotificationWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + instance_2 = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + instance_2 = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "ST", + + call_id: "ST", + + account_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + instance_2 = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + instance_2 = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::AddToQueueNotificationWebhook.new( + request_type: "TS", + + + call_id: "TS", + + + account_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + end + +end diff --git a/spec/models/answered_by_spec.rb b/spec/models/answered_by_spec.rb index 608e8ac0..12fa23aa 100644 --- a/spec/models/answered_by_spec.rb +++ b/spec/models/answered_by_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/application_list_spec.rb b/spec/models/application_list_spec.rb index 4be7d800..4cc17071 100644 --- a/spec/models/application_list_spec.rb +++ b/spec/models/application_list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,42 +104,66 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::ApplicationList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - applications: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::ApplicationList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + applications: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::ApplicationList' do - expect{instance = Freeclimb::ApplicationList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - applications: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::ApplicationList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + applications: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::ApplicationList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - applications: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::ApplicationList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + applications: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -147,13 +171,21 @@ it 'checks if properties are valid' do instance = Freeclimb::ApplicationList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + applications: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -173,25 +205,39 @@ obj = Object.new() instance_1 = Freeclimb::ApplicationList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - applications: Freeclimb::ApplicationResult.new(), + applications: [], + ) instance_2 = Freeclimb::ApplicationList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - applications: Freeclimb::ApplicationResult.new(), + applications: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,25 +245,39 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::ApplicationList.new( total: 2, + start: 2, + _end: 2, + page: 2, + num_pages: 2, + page_size: 2, + next_page_uri: "TS", - applications: Freeclimb::ApplicationResult.new(), + applications: [], + ) instance_2 = Freeclimb::ApplicationList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "ST", - applications: Freeclimb::ApplicationResult.new(), + applications: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -227,15 +287,23 @@ it 'calculates hash code' do instance = Freeclimb::ApplicationList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + applications: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -243,15 +311,41 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::ApplicationList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + applications: Array.new(), + ) - instance_2 = Freeclimb::ApplicationList.new + instance_2 = Freeclimb::ApplicationList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + applications: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -259,13 +353,21 @@ describe 'test method "_deserialize"' do instance = Freeclimb::ApplicationList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + applications: Array.new(), + ) it 'deserializes the data of total' do expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) @@ -297,13 +399,21 @@ it 'returns the string representation of the object' do instance = Freeclimb::ApplicationList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + applications: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -313,13 +423,21 @@ it 'returns the object in the form of hash' do instance = Freeclimb::ApplicationList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + applications: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -327,23 +445,39 @@ obj = Object.new() instance_1 = Freeclimb::ApplicationList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + applications: Array.new(), + ) instance_2 = Freeclimb::ApplicationList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + applications: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -352,20 +486,28 @@ describe 'test method "_to_hash"' do instance = Freeclimb::ApplicationList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + applications: Array.new(), + ) it 'returns total in the form of hash' do expect(instance._to_hash(instance.total)).to eq(instance.total) diff --git a/spec/models/application_request_spec.rb b/spec/models/application_request_spec.rb index e93b48fa..5f0a5387 100644 --- a/spec/models/application_request_spec.rb +++ b/spec/models/application_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -84,39 +84,60 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::ApplicationRequest.new( - _alias: "TS", - voice_url: "TS", - voice_fallback_url: "TS", - call_connect_url: "TS", - status_callback_url: "TS", - sms_url: "TS", - sms_fallback_url: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::ApplicationRequest.new( + _alias: "TS", + + voice_url: "TS", + + voice_fallback_url: "TS", + + call_connect_url: "TS", + + status_callback_url: "TS", + + sms_url: "TS", + + sms_fallback_url: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::ApplicationRequest' do - expect{instance = Freeclimb::ApplicationRequest.new( - _alias: "TS", - voice_url: "TS", - voice_fallback_url: "TS", - call_connect_url: "TS", - status_callback_url: "TS", - sms_url: "TS", - sms_fallback_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::ApplicationRequest.new( + _alias: "TS", + + voice_url: "TS", + + voice_fallback_url: "TS", + + call_connect_url: "TS", + + status_callback_url: "TS", + + sms_url: "TS", + + sms_fallback_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::ApplicationRequest.new( - _alias: "TS", - voice_url: "TS", - voice_fallback_url: "TS", - call_connect_url: "TS", - status_callback_url: "TS", - sms_url: "TS", - sms_fallback_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::ApplicationRequest.new( + _alias: "TS", + + voice_url: "TS", + + voice_fallback_url: "TS", + + call_connect_url: "TS", + + status_callback_url: "TS", + + sms_url: "TS", + + sms_fallback_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -124,12 +145,19 @@ it 'checks if properties are valid' do instance = Freeclimb::ApplicationRequest.new( _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) expect(instance.valid?).to eq(true) end @@ -149,21 +177,35 @@ obj = Object.new() instance_1 = Freeclimb::ApplicationRequest.new( _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) instance_2 = Freeclimb::ApplicationRequest.new( _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -171,21 +213,35 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::ApplicationRequest.new( _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) instance_2 = Freeclimb::ApplicationRequest.new( _alias: "ST", + voice_url: "ST", + voice_fallback_url: "ST", + call_connect_url: "ST", + status_callback_url: "ST", + sms_url: "ST", + sms_fallback_url: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -195,14 +251,21 @@ it 'calculates hash code' do instance = Freeclimb::ApplicationRequest.new( _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -210,14 +273,37 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::ApplicationRequest.new( _alias: "TS", + + voice_url: "TS", + + voice_fallback_url: "TS", + + call_connect_url: "TS", + + status_callback_url: "TS", + + sms_url: "TS", + + sms_fallback_url: "TS", + + ) + instance_2 = Freeclimb::ApplicationRequest.new( + _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) - instance_2 = Freeclimb::ApplicationRequest.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -225,12 +311,19 @@ describe 'test method "_deserialize"' do instance = Freeclimb::ApplicationRequest.new( _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) it 'deserializes the data of _alias' do expect(instance._deserialize("String", instance._alias)).to be_a_kind_of(String) @@ -259,12 +352,19 @@ it 'returns the string representation of the object' do instance = Freeclimb::ApplicationRequest.new( _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -274,12 +374,19 @@ it 'returns the object in the form of hash' do instance = Freeclimb::ApplicationRequest.new( _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -287,21 +394,35 @@ obj = Object.new() instance_1 = Freeclimb::ApplicationRequest.new( _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) instance_2 = Freeclimb::ApplicationRequest.new( _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -310,18 +431,25 @@ describe 'test method "_to_hash"' do instance = Freeclimb::ApplicationRequest.new( _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) it 'returns _alias in the form of hash' do expect(instance._to_hash(instance._alias)).to eq(instance._alias) diff --git a/spec/models/application_result_spec.rb b/spec/models/application_result_spec.rb index 84ff2c9a..05b36d88 100644 --- a/spec/models/application_result_spec.rb +++ b/spec/models/application_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -134,57 +134,96 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::ApplicationResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - account_id: "TS", - application_id: "TS", - _alias: "TS", - voice_url: "TS", - voice_fallback_url: "TS", - call_connect_url: "TS", - status_callback_url: "TS", - sms_url: "TS", - sms_fallback_url: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::ApplicationResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + application_id: "TS", + + _alias: "TS", + + voice_url: "TS", + + voice_fallback_url: "TS", + + call_connect_url: "TS", + + status_callback_url: "TS", + + sms_url: "TS", + + sms_fallback_url: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::ApplicationResult' do - expect{instance = Freeclimb::ApplicationResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - account_id: "TS", - application_id: "TS", - _alias: "TS", - voice_url: "TS", - voice_fallback_url: "TS", - call_connect_url: "TS", - status_callback_url: "TS", - sms_url: "TS", - sms_fallback_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::ApplicationResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + application_id: "TS", + + _alias: "TS", + + voice_url: "TS", + + voice_fallback_url: "TS", + + call_connect_url: "TS", + + status_callback_url: "TS", + + sms_url: "TS", + + sms_fallback_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::ApplicationResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - account_id: "TS", - application_id: "TS", - _alias: "TS", - voice_url: "TS", - voice_fallback_url: "TS", - call_connect_url: "TS", - status_callback_url: "TS", - sms_url: "TS", - sms_fallback_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::ApplicationResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + application_id: "TS", + + _alias: "TS", + + voice_url: "TS", + + voice_fallback_url: "TS", + + call_connect_url: "TS", + + status_callback_url: "TS", + + sms_url: "TS", + + sms_fallback_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -192,18 +231,31 @@ it 'checks if properties are valid' do instance = Freeclimb::ApplicationResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + application_id: "TS", + _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) expect(instance.valid?).to eq(true) end @@ -223,33 +275,59 @@ obj = Object.new() instance_1 = Freeclimb::ApplicationResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + application_id: "TS", + _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) instance_2 = Freeclimb::ApplicationResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + application_id: "TS", + _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -257,33 +335,59 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::ApplicationResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 2, + account_id: "TS", + application_id: "TS", + _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) instance_2 = Freeclimb::ApplicationResult.new( uri: "ST", + date_created: "ST", + date_updated: "ST", + revision: 1, + account_id: "ST", + application_id: "ST", + _alias: "ST", + voice_url: "ST", + voice_fallback_url: "ST", + call_connect_url: "ST", + status_callback_url: "ST", + sms_url: "ST", + sms_fallback_url: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -293,20 +397,33 @@ it 'calculates hash code' do instance = Freeclimb::ApplicationResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + application_id: "TS", + _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -314,20 +431,61 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::ApplicationResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + application_id: "TS", + _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) - instance_2 = Freeclimb::ApplicationResult.new + instance_2 = Freeclimb::ApplicationResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + application_id: "TS", + + _alias: "TS", + + voice_url: "TS", + + voice_fallback_url: "TS", + + call_connect_url: "TS", + + status_callback_url: "TS", + + sms_url: "TS", + + sms_fallback_url: "TS", + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -335,18 +493,31 @@ describe 'test method "_deserialize"' do instance = Freeclimb::ApplicationResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + application_id: "TS", + _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) it 'deserializes the data of uri' do expect(instance._deserialize("String", instance.uri)).to be_a_kind_of(String) @@ -393,18 +564,31 @@ it 'returns the string representation of the object' do instance = Freeclimb::ApplicationResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + application_id: "TS", + _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -414,18 +598,31 @@ it 'returns the object in the form of hash' do instance = Freeclimb::ApplicationResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + application_id: "TS", + _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -433,33 +630,59 @@ obj = Object.new() instance_1 = Freeclimb::ApplicationResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + application_id: "TS", + _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) instance_2 = Freeclimb::ApplicationResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + application_id: "TS", + _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -468,30 +691,43 @@ describe 'test method "_to_hash"' do instance = Freeclimb::ApplicationResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + application_id: "TS", + _alias: "TS", + voice_url: "TS", + voice_fallback_url: "TS", + call_connect_url: "TS", + status_callback_url: "TS", + sms_url: "TS", + sms_fallback_url: "TS", + ) it 'returns uri in the form of hash' do expect(instance._to_hash(instance.uri)).to eq(instance.uri) diff --git a/spec/models/available_number_list_spec.rb b/spec/models/available_number_list_spec.rb index b48444e5..283aa9f6 100644 --- a/spec/models/available_number_list_spec.rb +++ b/spec/models/available_number_list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,42 +104,66 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::AvailableNumberList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - available_phone_numbers: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::AvailableNumberList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + available_phone_numbers: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::AvailableNumberList' do - expect{instance = Freeclimb::AvailableNumberList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - available_phone_numbers: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::AvailableNumberList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + available_phone_numbers: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::AvailableNumberList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - available_phone_numbers: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::AvailableNumberList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + available_phone_numbers: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -147,13 +171,21 @@ it 'checks if properties are valid' do instance = Freeclimb::AvailableNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + available_phone_numbers: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -173,25 +205,39 @@ obj = Object.new() instance_1 = Freeclimb::AvailableNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - available_phone_numbers: Freeclimb::AvailableNumber.new(), + available_phone_numbers: [], + ) instance_2 = Freeclimb::AvailableNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - available_phone_numbers: Freeclimb::AvailableNumber.new(), + available_phone_numbers: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,25 +245,39 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::AvailableNumberList.new( total: 2, + start: 2, + _end: 2, + page: 2, + num_pages: 2, + page_size: 2, + next_page_uri: "TS", - available_phone_numbers: Freeclimb::AvailableNumber.new(), + available_phone_numbers: [], + ) instance_2 = Freeclimb::AvailableNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "ST", - available_phone_numbers: Freeclimb::AvailableNumber.new(), + available_phone_numbers: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -227,15 +287,23 @@ it 'calculates hash code' do instance = Freeclimb::AvailableNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + available_phone_numbers: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -243,15 +311,41 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::AvailableNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + available_phone_numbers: Array.new(), + ) - instance_2 = Freeclimb::AvailableNumberList.new + instance_2 = Freeclimb::AvailableNumberList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + available_phone_numbers: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -259,13 +353,21 @@ describe 'test method "_deserialize"' do instance = Freeclimb::AvailableNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + available_phone_numbers: Array.new(), + ) it 'deserializes the data of total' do expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) @@ -297,13 +399,21 @@ it 'returns the string representation of the object' do instance = Freeclimb::AvailableNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + available_phone_numbers: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -313,13 +423,21 @@ it 'returns the object in the form of hash' do instance = Freeclimb::AvailableNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + available_phone_numbers: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -327,23 +445,39 @@ obj = Object.new() instance_1 = Freeclimb::AvailableNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + available_phone_numbers: Array.new(), + ) instance_2 = Freeclimb::AvailableNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + available_phone_numbers: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -352,20 +486,28 @@ describe 'test method "_to_hash"' do instance = Freeclimb::AvailableNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + available_phone_numbers: Array.new(), + ) it 'returns total in the form of hash' do expect(instance._to_hash(instance.total)).to eq(instance.total) diff --git a/spec/models/available_number_spec.rb b/spec/models/available_number_spec.rb index 4811b7cc..d1ddc9f6 100644 --- a/spec/models/available_number_spec.rb +++ b/spec/models/available_number_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -84,52 +84,80 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::AvailableNumber.new( - capabilities: Freeclimb::Capabilities.new(), - campaign_id: "TS", - phone_number: "TS", - voice_enabled: true, - sms_enabled: true, - region: "TS", - country: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::AvailableNumber.new( + + capabilities: Freeclimb::Capabilities.new(), + campaign_id: "TS", + + phone_number: "TS", + + voice_enabled: true, + + sms_enabled: true, + + region: "TS", + + country: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::AvailableNumber' do - expect{instance = Freeclimb::AvailableNumber.new( - capabilities: Freeclimb::Capabilities.new, - campaign_id: "TS", - phone_number: "TS", - voice_enabled: true, - sms_enabled: true, - region: "TS", - country: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::AvailableNumber.new( + + capabilities: Freeclimb::Capabilities.new, + campaign_id: "TS", + + phone_number: "TS", + + voice_enabled: true, + + sms_enabled: true, + + region: "TS", + + country: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::AvailableNumber.new( - capabilities: Freeclimb::Capabilities.new, - campaign_id: "TS", - phone_number: "TS", - voice_enabled: true, - sms_enabled: true, - region: "TS", - country: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::AvailableNumber.new( + + capabilities: Freeclimb::Capabilities.new, + campaign_id: "TS", + + phone_number: "TS", + + voice_enabled: true, + + sms_enabled: true, + + region: "TS", + + country: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end describe 'test method "valid"' do it 'checks if properties are valid' do instance = Freeclimb::AvailableNumber.new( + capabilities: Freeclimb::Capabilities.new(), campaign_id: "TS", + phone_number: "TS", + voice_enabled: true, + sms_enabled: true, + region: "TS", + country: "TS", + ) expect(instance.valid?).to eq(true) end @@ -149,21 +177,35 @@ obj = Object.new() instance_1 = Freeclimb::AvailableNumber.new( capabilities: Freeclimb::Capabilities.new(), + campaign_id: "TS", + phone_number: "TS", + voice_enabled: true, + sms_enabled: true, + region: "TS", + country: "TS", + ) instance_2 = Freeclimb::AvailableNumber.new( capabilities: Freeclimb::Capabilities.new(), + campaign_id: "TS", + phone_number: "TS", + voice_enabled: true, + sms_enabled: true, + region: "TS", + country: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -171,21 +213,35 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::AvailableNumber.new( capabilities: Freeclimb::Capabilities.new(), + campaign_id: "TS", + phone_number: "TS", + voice_enabled: true, + sms_enabled: true, + region: "TS", + country: "TS", + ) instance_2 = Freeclimb::AvailableNumber.new( capabilities: Freeclimb::Capabilities.new(), + campaign_id: "ST", + phone_number: "ST", + voice_enabled: false, + sms_enabled: false, + region: "ST", + country: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -194,43 +250,80 @@ describe 'test method "hash"' do it 'calculates hash code' do instance = Freeclimb::AvailableNumber.new( + capabilities: Freeclimb::Capabilities.new(), campaign_id: "TS", + phone_number: "TS", + voice_enabled: true, + sms_enabled: true, + region: "TS", + country: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end describe 'test method "build_from_hash"' do it 'builds equivalent model from hash code' do instance_1 = Freeclimb::AvailableNumber.new( + + capabilities: Freeclimb::Capabilities.new(), + campaign_id: "TS", + + phone_number: "TS", + + voice_enabled: true, + + sms_enabled: true, + + region: "TS", + + country: "TS", + + ) + instance_2 = Freeclimb::AvailableNumber.new( + capabilities: Freeclimb::Capabilities.new(), campaign_id: "TS", + phone_number: "TS", + voice_enabled: true, + sms_enabled: true, + region: "TS", + country: "TS", + ) - instance_2 = Freeclimb::AvailableNumber.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end describe 'test method "_deserialize"' do instance = Freeclimb::AvailableNumber.new( + capabilities: Freeclimb::Capabilities.new, campaign_id: "TS", + phone_number: "TS", + voice_enabled: true, + sms_enabled: true, + region: "TS", + country: "TS", + ) it 'deserializes the data of capabilities' do expect(instance._deserialize("Object", instance.capabilities)).to be_a_kind_of(Freeclimb::Capabilities) @@ -258,13 +351,20 @@ describe 'test method "to_s"' do it 'returns the string representation of the object' do instance = Freeclimb::AvailableNumber.new( + capabilities: Freeclimb::Capabilities.new, campaign_id: "TS", + phone_number: "TS", + voice_enabled: true, + sms_enabled: true, + region: "TS", + country: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -273,35 +373,56 @@ describe 'test method "to_hash"' do it 'returns the object in the form of hash' do instance = Freeclimb::AvailableNumber.new( + capabilities: Freeclimb::Capabilities.new, campaign_id: "TS", + phone_number: "TS", + voice_enabled: true, + sms_enabled: true, + region: "TS", + country: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end it 'creates equal hash for two equal objects' do obj = Object.new() instance_1 = Freeclimb::AvailableNumber.new( + capabilities: Freeclimb::Capabilities.new, campaign_id: "TS", + phone_number: "TS", + voice_enabled: true, + sms_enabled: true, + region: "TS", + country: "TS", + ) instance_2 = Freeclimb::AvailableNumber.new( + capabilities: Freeclimb::Capabilities.new, campaign_id: "TS", + phone_number: "TS", + voice_enabled: true, + sms_enabled: true, + region: "TS", + country: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -309,18 +430,25 @@ describe 'test method "_to_hash"' do instance = Freeclimb::AvailableNumber.new( + campaign_id: "TS", + phone_number: "TS", + voice_enabled: true, + sms_enabled: true, + region: "TS", + country: "TS", + ) it 'returns capabilities in the form of hash' do expect(instance._to_hash(instance.capabilities)).to eq(instance.capabilities) diff --git a/spec/models/barge_in_reason_spec.rb b/spec/models/barge_in_reason_spec.rb new file mode 100644 index 00000000..d5e2e434 --- /dev/null +++ b/spec/models/barge_in_reason_spec.rb @@ -0,0 +1,77 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::BargeInReason +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::BargeInReason do + let(:instance) { Freeclimb::BargeInReason.new } + + describe 'test an instance of BargeInReason' do + it 'should create an instance of BargeInReason' do + expect(instance).to be_instance_of(Freeclimb::BargeInReason) + end + end + + describe 'test attribute "NO_BARGE_IN"' do + it 'should work' do + expect { Freeclimb::BargeInReason::NO_BARGE_IN = "noBargeIn" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::BargeInReason::NO_BARGE_IN + calculatedValue = Freeclimb::BargeInReason::build_from_hash("noBargeIn") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "noBargeIn" + calculatedValue = Freeclimb::BargeInReason::NO_BARGE_IN + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "BARGE_IN_BY_DTMF"' do + it 'should work' do + expect { Freeclimb::BargeInReason::BARGE_IN_BY_DTMF = "bargeInByDTMF" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::BargeInReason::BARGE_IN_BY_DTMF + calculatedValue = Freeclimb::BargeInReason::build_from_hash("bargeInByDTMF") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "bargeInByDTMF" + calculatedValue = Freeclimb::BargeInReason::BARGE_IN_BY_DTMF + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "BARGE_IN_BY_ENERGY"' do + it 'should work' do + expect { Freeclimb::BargeInReason::BARGE_IN_BY_ENERGY = "bargeInByEnergy" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::BargeInReason::BARGE_IN_BY_ENERGY + calculatedValue = Freeclimb::BargeInReason::build_from_hash("bargeInByEnergy") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "bargeInByEnergy" + calculatedValue = Freeclimb::BargeInReason::BARGE_IN_BY_ENERGY + expect(expectedValue).to eq(calculatedValue) + end + end + +end diff --git a/spec/models/buy_incoming_number_request_spec.rb b/spec/models/buy_incoming_number_request_spec.rb index 8c24d493..31afc860 100644 --- a/spec/models/buy_incoming_number_request_spec.rb +++ b/spec/models/buy_incoming_number_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -52,27 +52,36 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::BuyIncomingNumberRequest.new( - phone_number: "TS", - _alias: "TS", - application_id: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::BuyIncomingNumberRequest.new( + phone_number: "TS", + + _alias: "TS", + + application_id: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::BuyIncomingNumberRequest' do - expect{instance = Freeclimb::BuyIncomingNumberRequest.new( - phone_number: "TS", - _alias: "TS", - application_id: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::BuyIncomingNumberRequest.new( + phone_number: "TS", + + _alias: "TS", + + application_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::BuyIncomingNumberRequest.new( - phone_number: "TS", - _alias: "TS", - application_id: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::BuyIncomingNumberRequest.new( + phone_number: "TS", + + _alias: "TS", + + application_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -80,8 +89,11 @@ it 'checks if properties are valid' do instance = Freeclimb::BuyIncomingNumberRequest.new( phone_number: "TS", + _alias: "TS", + application_id: "TS", + ) expect(instance.valid?).to eq(true) end @@ -101,13 +113,19 @@ obj = Object.new() instance_1 = Freeclimb::BuyIncomingNumberRequest.new( phone_number: "TS", + _alias: "TS", + application_id: "TS", + ) instance_2 = Freeclimb::BuyIncomingNumberRequest.new( phone_number: "TS", + _alias: "TS", + application_id: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -115,13 +133,19 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::BuyIncomingNumberRequest.new( phone_number: "TS", + _alias: "TS", + application_id: "TS", + ) instance_2 = Freeclimb::BuyIncomingNumberRequest.new( phone_number: "ST", + _alias: "ST", + application_id: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -131,10 +155,13 @@ it 'calculates hash code' do instance = Freeclimb::BuyIncomingNumberRequest.new( phone_number: "TS", + _alias: "TS", + application_id: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -142,10 +169,21 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::BuyIncomingNumberRequest.new( phone_number: "TS", + _alias: "TS", + application_id: "TS", + ) - instance_2 = Freeclimb::BuyIncomingNumberRequest.new + instance_2 = Freeclimb::BuyIncomingNumberRequest.new( + phone_number: "TS", + + _alias: "TS", + + application_id: "TS", + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -153,8 +191,11 @@ describe 'test method "_deserialize"' do instance = Freeclimb::BuyIncomingNumberRequest.new( phone_number: "TS", + _alias: "TS", + application_id: "TS", + ) it 'deserializes the data of phone_number' do expect(instance._deserialize("String", instance.phone_number)).to be_a_kind_of(String) @@ -171,8 +212,11 @@ it 'returns the string representation of the object' do instance = Freeclimb::BuyIncomingNumberRequest.new( phone_number: "TS", + _alias: "TS", + application_id: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -182,8 +226,11 @@ it 'returns the object in the form of hash' do instance = Freeclimb::BuyIncomingNumberRequest.new( phone_number: "TS", + _alias: "TS", + application_id: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -191,13 +238,19 @@ obj = Object.new() instance_1 = Freeclimb::BuyIncomingNumberRequest.new( phone_number: "TS", + _alias: "TS", + application_id: "TS", + ) instance_2 = Freeclimb::BuyIncomingNumberRequest.new( phone_number: "TS", + _alias: "TS", + application_id: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -206,10 +259,13 @@ describe 'test method "_to_hash"' do instance = Freeclimb::BuyIncomingNumberRequest.new( phone_number: "TS", + _alias: "TS", + application_id: "TS", + ) it 'returns phone_number in the form of hash' do expect(instance._to_hash(instance.phone_number)).to eq(instance.phone_number) diff --git a/spec/models/call_control_webhook_spec.rb b/spec/models/call_control_webhook_spec.rb new file mode 100644 index 00000000..0bc59d2e --- /dev/null +++ b/spec/models/call_control_webhook_spec.rb @@ -0,0 +1,385 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::CallControlWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::CallControlWebhook do + let(:instance) { Freeclimb::CallControlWebhook.new } + + describe 'test an instance of CallControlWebhook' do + it 'should create an instance of CallControlWebhook' do + expect(instance).to be_instance_of(Freeclimb::CallControlWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of CallControlWebhook' do + payload = '{ "requestType": "callControl" }' + expect(Freeclimb::CallControlWebhook.deserialize(payload)).to be_instance_of(Freeclimb::CallControlWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "digits"' do + it 'should work' do + instance.digits = "TEST_STRING" + expect(instance.digits).to eq("TEST_STRING") + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::CallControlWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + conference_id: "TS", + + digits: "TS", + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::CallControlWebhook' do + expect { instance = Freeclimb::CallControlWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + conference_id: "TS", + + digits: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::CallControlWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + conference_id: "TS", + + digits: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::CallControlWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + conference_id: "TS", + + digits: "TS", + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::CallControlWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::CallControlWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + conference_id: "TS", + + digits: "TS", + + ) + instance_2 = Freeclimb::CallControlWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + conference_id: "TS", + + digits: "TS", + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::CallControlWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + conference_id: "TS", + + digits: "TS", + + ) + instance_2 = Freeclimb::CallControlWebhook.new( + request_type: "ST", + + call_id: "ST", + + account_id: "ST", + + conference_id: "ST", + + digits: "ST", + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::CallControlWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + conference_id: "TS", + + digits: "TS", + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::CallControlWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + conference_id: "TS", + + digits: "TS", + + ) + instance_2 = Freeclimb::CallControlWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + conference_id: "TS", + + digits: "TS", + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::CallControlWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + conference_id: "TS", + + digits: "TS", + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of digits' do + expect(instance._deserialize("String", instance.digits)).to be_a_kind_of(String) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::CallControlWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + conference_id: "TS", + + digits: "TS", + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::CallControlWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + conference_id: "TS", + + digits: "TS", + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::CallControlWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + conference_id: "TS", + + digits: "TS", + + ) + instance_2 = Freeclimb::CallControlWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + conference_id: "TS", + + digits: "TS", + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::CallControlWebhook.new( + request_type: "TS", + + + call_id: "TS", + + + account_id: "TS", + + + conference_id: "TS", + + + digits: "TS", + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns digits in the form of hash' do + expect(instance._to_hash(instance.digits)).to eq(instance.digits) + end + end + +end diff --git a/spec/models/call_direction_spec.rb b/spec/models/call_direction_spec.rb index b6944de5..01dbfcd1 100644 --- a/spec/models/call_direction_spec.rb +++ b/spec/models/call_direction_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/call_ended_reason_spec.rb b/spec/models/call_ended_reason_spec.rb new file mode 100644 index 00000000..0cf9e9b0 --- /dev/null +++ b/spec/models/call_ended_reason_spec.rb @@ -0,0 +1,397 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::CallEndedReason +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::CallEndedReason do + let(:instance) { Freeclimb::CallEndedReason.new } + + describe 'test an instance of CallEndedReason' do + it 'should create an instance of CallEndedReason' do + expect(instance).to be_instance_of(Freeclimb::CallEndedReason) + end + end + + describe 'test attribute "BUSY"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::BUSY = "busy" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::BUSY + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("busy") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "busy" + calculatedValue = Freeclimb::CallEndedReason::BUSY + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "FAILED"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::FAILED = "failed" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::FAILED + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("failed") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "failed" + calculatedValue = Freeclimb::CallEndedReason::FAILED + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "NO_ANSWER"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::NO_ANSWER = "noAnswer" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::NO_ANSWER + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("noAnswer") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "noAnswer" + calculatedValue = Freeclimb::CallEndedReason::NO_ANSWER + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "CALL_CANCELED"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::CALL_CANCELED = "callCanceled" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::CALL_CANCELED + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("callCanceled") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "callCanceled" + calculatedValue = Freeclimb::CallEndedReason::CALL_CANCELED + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "FAR_END_HANGUP"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::FAR_END_HANGUP = "farEndHangup" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::FAR_END_HANGUP + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("farEndHangup") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "farEndHangup" + calculatedValue = Freeclimb::CallEndedReason::FAR_END_HANGUP + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "APP_HANGUP"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::APP_HANGUP = "appHangup" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::APP_HANGUP + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("appHangup") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "appHangup" + calculatedValue = Freeclimb::CallEndedReason::APP_HANGUP + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "APP_REJECT"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::APP_REJECT = "appReject" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::APP_REJECT + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("appReject") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "appReject" + calculatedValue = Freeclimb::CallEndedReason::APP_REJECT + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "APP_NO_PERCL"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::APP_NO_PERCL = "appNoPercl" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::APP_NO_PERCL + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("appNoPercl") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "appNoPercl" + calculatedValue = Freeclimb::CallEndedReason::APP_NO_PERCL + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "APP_INVALID_PERCL"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::APP_INVALID_PERCL = "appInvalidPercl" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::APP_INVALID_PERCL + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("appInvalidPercl") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "appInvalidPercl" + calculatedValue = Freeclimb::CallEndedReason::APP_INVALID_PERCL + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "CONFERENCE_TERMINATED"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::CONFERENCE_TERMINATED = "conferenceTerminated" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::CONFERENCE_TERMINATED + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("conferenceTerminated") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "conferenceTerminated" + calculatedValue = Freeclimb::CallEndedReason::CONFERENCE_TERMINATED + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "CONFERENCE_EMPTIED"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::CONFERENCE_EMPTIED = "conferenceEmptied" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::CONFERENCE_EMPTIED + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("conferenceEmptied") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "conferenceEmptied" + calculatedValue = Freeclimb::CallEndedReason::CONFERENCE_EMPTIED + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "REMOVED_FROM_CONFERENCE"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::REMOVED_FROM_CONFERENCE = "removedFromConference" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::REMOVED_FROM_CONFERENCE + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("removedFromConference") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "removedFromConference" + calculatedValue = Freeclimb::CallEndedReason::REMOVED_FROM_CONFERENCE + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "MACHINE_DETECTED"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::MACHINE_DETECTED = "machineDetected" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::MACHINE_DETECTED + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("machineDetected") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "machineDetected" + calculatedValue = Freeclimb::CallEndedReason::MACHINE_DETECTED + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "WEBHOOK_FAILED"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::WEBHOOK_FAILED = "webhookFailed" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::WEBHOOK_FAILED + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("webhookFailed") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "webhookFailed" + calculatedValue = Freeclimb::CallEndedReason::WEBHOOK_FAILED + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "WEBHOOK_INVALID_RESPONSE"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::WEBHOOK_INVALID_RESPONSE = "webhookInvalidResponse" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::WEBHOOK_INVALID_RESPONSE + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("webhookInvalidResponse") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "webhookInvalidResponse" + calculatedValue = Freeclimb::CallEndedReason::WEBHOOK_INVALID_RESPONSE + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "VOICE_DISABLED"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::VOICE_DISABLED = "voiceDisabled" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::VOICE_DISABLED + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("voiceDisabled") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "voiceDisabled" + calculatedValue = Freeclimb::CallEndedReason::VOICE_DISABLED + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "CONFIG_ERROR_NO_APPLICATION"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::CONFIG_ERROR_NO_APPLICATION = "configErrorNoApplication" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::CONFIG_ERROR_NO_APPLICATION + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("configErrorNoApplication") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "configErrorNoApplication" + calculatedValue = Freeclimb::CallEndedReason::CONFIG_ERROR_NO_APPLICATION + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "CONFIG_ERROR_NO_VOICE_URL"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::CONFIG_ERROR_NO_VOICE_URL = "configErrorNoVoiceUrl" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::CONFIG_ERROR_NO_VOICE_URL + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("configErrorNoVoiceUrl") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "configErrorNoVoiceUrl" + calculatedValue = Freeclimb::CallEndedReason::CONFIG_ERROR_NO_VOICE_URL + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "MAX_REDIRECTS_ERROR"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::MAX_REDIRECTS_ERROR = "maxRedirectsError" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::MAX_REDIRECTS_ERROR + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("maxRedirectsError") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "maxRedirectsError" + calculatedValue = Freeclimb::CallEndedReason::MAX_REDIRECTS_ERROR + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "PERCL_PROCESSING_ERROR"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::PERCL_PROCESSING_ERROR = "perclProcessingError" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::PERCL_PROCESSING_ERROR + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("perclProcessingError") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "perclProcessingError" + calculatedValue = Freeclimb::CallEndedReason::PERCL_PROCESSING_ERROR + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "INTERNAL_ERROR"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::INTERNAL_ERROR = "internalError" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::INTERNAL_ERROR + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("internalError") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "internalError" + calculatedValue = Freeclimb::CallEndedReason::INTERNAL_ERROR + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "GRPC_HANGUP"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::GRPC_HANGUP = "grpcHangup" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::GRPC_HANGUP + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("grpcHangup") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "grpcHangup" + calculatedValue = Freeclimb::CallEndedReason::GRPC_HANGUP + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "MAX_DURATION"' do + it 'should work' do + expect { Freeclimb::CallEndedReason::MAX_DURATION = "maxDuration" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CallEndedReason::MAX_DURATION + calculatedValue = Freeclimb::CallEndedReason::build_from_hash("maxDuration") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "maxDuration" + calculatedValue = Freeclimb::CallEndedReason::MAX_DURATION + expect(expectedValue).to eq(calculatedValue) + end + end + +end diff --git a/spec/models/call_list_spec.rb b/spec/models/call_list_spec.rb index 792e405c..305f33d9 100644 --- a/spec/models/call_list_spec.rb +++ b/spec/models/call_list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,42 +104,66 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::CallList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - calls: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::CallList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + calls: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::CallList' do - expect{instance = Freeclimb::CallList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - calls: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::CallList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + calls: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::CallList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - calls: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::CallList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + calls: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -147,13 +171,21 @@ it 'checks if properties are valid' do instance = Freeclimb::CallList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + calls: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -173,25 +205,39 @@ obj = Object.new() instance_1 = Freeclimb::CallList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - calls: Freeclimb::CallResult.new(), + calls: [], + ) instance_2 = Freeclimb::CallList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - calls: Freeclimb::CallResult.new(), + calls: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,25 +245,39 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::CallList.new( total: 2, + start: 2, + _end: 2, + page: 2, + num_pages: 2, + page_size: 2, + next_page_uri: "TS", - calls: Freeclimb::CallResult.new(), + calls: [], + ) instance_2 = Freeclimb::CallList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "ST", - calls: Freeclimb::CallResult.new(), + calls: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -227,15 +287,23 @@ it 'calculates hash code' do instance = Freeclimb::CallList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + calls: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -243,15 +311,41 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::CallList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + calls: Array.new(), + ) - instance_2 = Freeclimb::CallList.new + instance_2 = Freeclimb::CallList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + calls: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -259,13 +353,21 @@ describe 'test method "_deserialize"' do instance = Freeclimb::CallList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + calls: Array.new(), + ) it 'deserializes the data of total' do expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) @@ -297,13 +399,21 @@ it 'returns the string representation of the object' do instance = Freeclimb::CallList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + calls: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -313,13 +423,21 @@ it 'returns the object in the form of hash' do instance = Freeclimb::CallList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + calls: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -327,23 +445,39 @@ obj = Object.new() instance_1 = Freeclimb::CallList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + calls: Array.new(), + ) instance_2 = Freeclimb::CallList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + calls: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -352,20 +486,28 @@ describe 'test method "_to_hash"' do instance = Freeclimb::CallList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + calls: Array.new(), + ) it 'returns total in the form of hash' do expect(instance._to_hash(instance.total)).to eq(instance.total) diff --git a/spec/models/call_result_spec.rb b/spec/models/call_result_spec.rb index 8558ebab..458d3a6c 100644 --- a/spec/models/call_result_spec.rb +++ b/spec/models/call_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -143,7 +143,6 @@ expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) end end - describe 'test attribute "start_time"' do it 'should work' do instance.start_time = "TEST_STRING" @@ -204,7 +203,6 @@ end end - describe 'test attribute "answered_by"' do it 'assigns value HUMAN' do instance.answered_by = Freeclimb::AnsweredBy::HUMAN @@ -215,7 +213,6 @@ expect(instance.answered_by).to eq(Freeclimb::AnsweredBy::MACHINE) end end - describe 'test attribute "subresource_uris"' do it 'should work' do @@ -225,77 +222,157 @@ end end + describe 'test attribute "application_id"' do + it 'should work' do + instance.application_id = "TEST_STRING" + expect(instance.application_id).to eq("TEST_STRING") + + end + end + describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::CallResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - call_id: "TS", - parent_call_id: "TS", - account_id: "TS", - from: "TS", - to: "TS", - phone_number_id: "TS", - call_status: "QUEUED", - start_time: "TS", - connect_time: "TS", - end_time: "TS", - duration: 1, - connect_duration: 1, - direction: "INBOUND", - answered_by: "HUMAN", - subresource_uris: Object.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::CallResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + call_id: "TS", + + parent_call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + phone_number_id: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + start_time: "TS", + + connect_time: "TS", + + end_time: "TS", + + duration: 1, + + connect_duration: 1, + + + direction: Freeclimb::CallDirection::INBOUND, + + + answered_by: Freeclimb::AnsweredBy::HUMAN, + + subresource_uris: Object.new(), + + application_id: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::CallResult' do - expect{instance = Freeclimb::CallResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - call_id: "TS", - parent_call_id: "TS", - account_id: "TS", - from: "TS", - to: "TS", - phone_number_id: "TS", - call_status: "QUEUED", - start_time: "TS", - connect_time: "TS", - end_time: "TS", - duration: 1, - connect_duration: 1, - direction: "INBOUND", - answered_by: "HUMAN", - subresource_uris: Object.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::CallResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + call_id: "TS", + + parent_call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + phone_number_id: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + start_time: "TS", + + connect_time: "TS", + + end_time: "TS", + + duration: 1, + + connect_duration: 1, + + + direction: Freeclimb::CallDirection::INBOUND, + + + answered_by: Freeclimb::AnsweredBy::HUMAN, + + subresource_uris: Object.new(), + + application_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::CallResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - call_id: "TS", - parent_call_id: "TS", - account_id: "TS", - from: "TS", - to: "TS", - phone_number_id: "TS", - call_status: "QUEUED", - start_time: "TS", - connect_time: "TS", - end_time: "TS", - duration: 1, - connect_duration: 1, - direction: "INBOUND", - answered_by: "HUMAN", - subresource_uris: Object.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::CallResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + call_id: "TS", + + parent_call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + phone_number_id: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + start_time: "TS", + + connect_time: "TS", + + end_time: "TS", + + duration: 1, + + connect_duration: 1, + + + direction: Freeclimb::CallDirection::INBOUND, + + + answered_by: Freeclimb::AnsweredBy::HUMAN, + + subresource_uris: Object.new(), + + application_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -303,24 +380,48 @@ it 'checks if properties are valid' do instance = Freeclimb::CallResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + call_id: "TS", + parent_call_id: "TS", + account_id: "TS", + from: "TS", + to: "TS", + phone_number_id: "TS", - call_status: "QUEUED", + + + call_status: Freeclimb::CallStatus::QUEUED, + start_time: "TS", + connect_time: "TS", + end_time: "TS", + duration: 1, + connect_duration: 1, - direction: "INBOUND", - answered_by: "HUMAN", + + + direction: Freeclimb::CallDirection::INBOUND, + + + answered_by: Freeclimb::AnsweredBy::HUMAN, + subresource_uris: Object.new(), + + application_id: "TS", + ) expect(instance.valid?).to eq(true) end @@ -340,51 +441,93 @@ obj = Object.new() instance_1 = Freeclimb::CallResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + call_id: "TS", + parent_call_id: "TS", + account_id: "TS", + from: "TS", + to: "TS", + phone_number_id: "TS", - call_status: Freeclimb::CallStatus.new(), - call_status: "QUEUED", + + + call_status: Freeclimb::CallStatus::QUEUED, + start_time: "TS", + connect_time: "TS", + end_time: "TS", + duration: 1, + connect_duration: 1, - direction: Freeclimb::CallDirection.new(), - direction: "INBOUND", - answered_by: Freeclimb::AnsweredBy.new(), - answered_by: "HUMAN", + + + direction: Freeclimb::CallDirection::INBOUND, + + + answered_by: Freeclimb::AnsweredBy::HUMAN, + subresource_uris: obj, + + application_id: "TS", + ) instance_2 = Freeclimb::CallResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + call_id: "TS", + parent_call_id: "TS", + account_id: "TS", + from: "TS", + to: "TS", + phone_number_id: "TS", - call_status: Freeclimb::CallStatus.new(), - call_status: "QUEUED", + + + call_status: Freeclimb::CallStatus::QUEUED, + start_time: "TS", + connect_time: "TS", + end_time: "TS", + duration: 1, + connect_duration: 1, - direction: Freeclimb::CallDirection.new(), - direction: "INBOUND", - answered_by: Freeclimb::AnsweredBy.new(), - answered_by: "HUMAN", + + + direction: Freeclimb::CallDirection::INBOUND, + + + answered_by: Freeclimb::AnsweredBy::HUMAN, + subresource_uris: obj, + + application_id: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -392,51 +535,93 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::CallResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 2, + call_id: "TS", + parent_call_id: "TS", + account_id: "TS", + from: "TS", + to: "TS", + phone_number_id: "TS", - call_status: Freeclimb::CallStatus.new(), - call_status: "QUEUED", + + + call_status: Freeclimb::CallStatus::QUEUED, + start_time: "TS", + connect_time: "TS", + end_time: "TS", + duration: 2, + connect_duration: 2, - direction: Freeclimb::CallDirection.new(), - direction: "INBOUND", - answered_by: Freeclimb::AnsweredBy.new(), - answered_by: "HUMAN", + + + direction: Freeclimb::CallDirection::INBOUND, + + + answered_by: Freeclimb::AnsweredBy::HUMAN, + subresource_uris: Object.new(), + + application_id: "TS", + ) instance_2 = Freeclimb::CallResult.new( uri: "ST", + date_created: "ST", + date_updated: "ST", + revision: 1, + call_id: "ST", + parent_call_id: "ST", + account_id: "ST", + from: "ST", + to: "ST", + phone_number_id: "ST", - call_status: Freeclimb::CallStatus.new(), - call_status: "RINGING", + + + call_status: nil, + start_time: "ST", + connect_time: "ST", + end_time: "ST", + duration: 1, + connect_duration: 1, - direction: Freeclimb::CallDirection.new(), - direction: "OUTBOUND_API", - answered_by: Freeclimb::AnsweredBy.new(), - answered_by: "MACHINE", + + + direction: nil, + + + answered_by: nil, + subresource_uris: nil, + + application_id: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -446,26 +631,50 @@ it 'calculates hash code' do instance = Freeclimb::CallResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + call_id: "TS", + parent_call_id: "TS", + account_id: "TS", + from: "TS", + to: "TS", + phone_number_id: "TS", - call_status: "QUEUED", + + + call_status: Freeclimb::CallStatus::QUEUED, + start_time: "TS", + connect_time: "TS", + end_time: "TS", + duration: 1, + connect_duration: 1, - direction: "INBOUND", - answered_by: "HUMAN", + + + direction: Freeclimb::CallDirection::INBOUND, + + + answered_by: Freeclimb::AnsweredBy::HUMAN, + subresource_uris: Object.new(), + + application_id: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -473,26 +682,95 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::CallResult.new( uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + call_id: "TS", + + parent_call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + phone_number_id: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + start_time: "TS", + + connect_time: "TS", + + end_time: "TS", + + duration: 1, + + connect_duration: 1, + + + direction: Freeclimb::CallDirection::INBOUND, + + + answered_by: Freeclimb::AnsweredBy::HUMAN, + + subresource_uris: Object.new(), + + application_id: "TS", + + ) + instance_2 = Freeclimb::CallResult.new( + uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + call_id: "TS", + parent_call_id: "TS", + account_id: "TS", + from: "TS", + to: "TS", + phone_number_id: "TS", - call_status: "QUEUED", + + + call_status: Freeclimb::CallStatus::QUEUED, + start_time: "TS", + connect_time: "TS", + end_time: "TS", + duration: 1, + connect_duration: 1, - direction: "INBOUND", - answered_by: "HUMAN", + + + direction: Freeclimb::CallDirection::INBOUND, + + + answered_by: Freeclimb::AnsweredBy::HUMAN, + subresource_uris: Object.new(), + + application_id: "TS", + ) - instance_2 = Freeclimb::CallResult.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -500,24 +778,48 @@ describe 'test method "_deserialize"' do instance = Freeclimb::CallResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + call_id: "TS", + parent_call_id: "TS", + account_id: "TS", + from: "TS", + to: "TS", + phone_number_id: "TS", - call_status: "QUEUED", + + + call_status: Freeclimb::CallStatus::QUEUED, + start_time: "TS", + connect_time: "TS", + end_time: "TS", + duration: 1, + connect_duration: 1, - direction: "INBOUND", - answered_by: "HUMAN", + + + direction: Freeclimb::CallDirection::INBOUND, + + + answered_by: Freeclimb::AnsweredBy::HUMAN, + subresource_uris: Object.new(), + + application_id: "TS", + ) it 'deserializes the data of uri' do expect(instance._deserialize("String", instance.uri)).to be_a_kind_of(String) @@ -567,30 +869,57 @@ it 'deserializes the data of subresource_uris' do expect(instance._deserialize("Object", instance.subresource_uris)).to be_a_kind_of(Object) end + it 'deserializes the data of application_id' do + expect(instance._deserialize("String", instance.application_id)).to be_a_kind_of(String) + end end describe 'test method "to_s"' do it 'returns the string representation of the object' do instance = Freeclimb::CallResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + call_id: "TS", + parent_call_id: "TS", + account_id: "TS", + from: "TS", + to: "TS", + phone_number_id: "TS", - call_status: "QUEUED", + + + call_status: Freeclimb::CallStatus::QUEUED, + start_time: "TS", + connect_time: "TS", + end_time: "TS", + duration: 1, + connect_duration: 1, - direction: "INBOUND", - answered_by: "HUMAN", + + + direction: Freeclimb::CallDirection::INBOUND, + + + answered_by: Freeclimb::AnsweredBy::HUMAN, + subresource_uris: Object.new(), + + application_id: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -600,24 +929,48 @@ it 'returns the object in the form of hash' do instance = Freeclimb::CallResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + call_id: "TS", + parent_call_id: "TS", + account_id: "TS", + from: "TS", + to: "TS", + phone_number_id: "TS", - call_status: "QUEUED", + + + call_status: Freeclimb::CallStatus::QUEUED, + start_time: "TS", + connect_time: "TS", + end_time: "TS", + duration: 1, + connect_duration: 1, - direction: "INBOUND", - answered_by: "HUMAN", + + + direction: Freeclimb::CallDirection::INBOUND, + + + answered_by: Freeclimb::AnsweredBy::HUMAN, + subresource_uris: Object.new(), + + application_id: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -625,45 +978,93 @@ obj = Object.new() instance_1 = Freeclimb::CallResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + call_id: "TS", + parent_call_id: "TS", + account_id: "TS", + from: "TS", + to: "TS", + phone_number_id: "TS", - call_status: "QUEUED", + + + call_status: Freeclimb::CallStatus::QUEUED, + start_time: "TS", + connect_time: "TS", + end_time: "TS", + duration: 1, + connect_duration: 1, - direction: "INBOUND", - answered_by: "HUMAN", + + + direction: Freeclimb::CallDirection::INBOUND, + + + answered_by: Freeclimb::AnsweredBy::HUMAN, + subresource_uris: obj, + + application_id: "TS", + ) instance_2 = Freeclimb::CallResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + call_id: "TS", + parent_call_id: "TS", + account_id: "TS", + from: "TS", + to: "TS", + phone_number_id: "TS", - call_status: "QUEUED", + + + call_status: Freeclimb::CallStatus::QUEUED, + start_time: "TS", + connect_time: "TS", + end_time: "TS", + duration: 1, + connect_duration: 1, - direction: "INBOUND", - answered_by: "HUMAN", + + + direction: Freeclimb::CallDirection::INBOUND, + + + answered_by: Freeclimb::AnsweredBy::HUMAN, + subresource_uris: obj, + + application_id: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -672,42 +1073,67 @@ describe 'test method "_to_hash"' do instance = Freeclimb::CallResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + call_id: "TS", + parent_call_id: "TS", + account_id: "TS", + from: "TS", + to: "TS", + phone_number_id: "TS", + - call_status: "QUEUED", + + call_status: Freeclimb::CallStatus::QUEUED, + start_time: "TS", + connect_time: "TS", + end_time: "TS", + duration: 1, + connect_duration: 1, + - direction: "INBOUND", + + direction: Freeclimb::CallDirection::INBOUND, + - answered_by: "HUMAN", + + answered_by: Freeclimb::AnsweredBy::HUMAN, + subresource_uris: Object.new(), + + + application_id: "TS", + ) it 'returns uri in the form of hash' do expect(instance._to_hash(instance.uri)).to eq(instance.uri) @@ -766,6 +1192,9 @@ it 'returns subresource_uris in the form of hash' do expect(instance._to_hash(instance.subresource_uris)).to eq(instance.subresource_uris) end + it 'returns application_id in the form of hash' do + expect(instance._to_hash(instance.application_id)).to eq(instance.application_id) + end end end diff --git a/spec/models/call_status_spec.rb b/spec/models/call_status_spec.rb index 69d82858..8c429bb0 100644 --- a/spec/models/call_status_spec.rb +++ b/spec/models/call_status_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/call_status_webhook_spec.rb b/spec/models/call_status_webhook_spec.rb new file mode 100644 index 00000000..f00f755b --- /dev/null +++ b/spec/models/call_status_webhook_spec.rb @@ -0,0 +1,793 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::CallStatusWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::CallStatusWebhook do + let(:instance) { Freeclimb::CallStatusWebhook.new } + + describe 'test an instance of CallStatusWebhook' do + it 'should create an instance of CallStatusWebhook' do + expect(instance).to be_instance_of(Freeclimb::CallStatusWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of CallStatusWebhook' do + payload = '{ "requestType": "callStatus" }' + expect(Freeclimb::CallStatusWebhook.deserialize(payload)).to be_instance_of(Freeclimb::CallStatusWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "call_ended_reason"' do + it 'assigns value BUSY' do + instance.call_ended_reason = Freeclimb::CallEndedReason::BUSY + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::BUSY) + end + it 'assigns value FAILED' do + instance.call_ended_reason = Freeclimb::CallEndedReason::FAILED + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::FAILED) + end + it 'assigns value NO_ANSWER' do + instance.call_ended_reason = Freeclimb::CallEndedReason::NO_ANSWER + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::NO_ANSWER) + end + it 'assigns value CALL_CANCELED' do + instance.call_ended_reason = Freeclimb::CallEndedReason::CALL_CANCELED + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::CALL_CANCELED) + end + it 'assigns value FAR_END_HANGUP' do + instance.call_ended_reason = Freeclimb::CallEndedReason::FAR_END_HANGUP + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::FAR_END_HANGUP) + end + it 'assigns value APP_HANGUP' do + instance.call_ended_reason = Freeclimb::CallEndedReason::APP_HANGUP + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::APP_HANGUP) + end + it 'assigns value APP_REJECT' do + instance.call_ended_reason = Freeclimb::CallEndedReason::APP_REJECT + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::APP_REJECT) + end + it 'assigns value APP_NO_PERCL' do + instance.call_ended_reason = Freeclimb::CallEndedReason::APP_NO_PERCL + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::APP_NO_PERCL) + end + it 'assigns value APP_INVALID_PERCL' do + instance.call_ended_reason = Freeclimb::CallEndedReason::APP_INVALID_PERCL + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::APP_INVALID_PERCL) + end + it 'assigns value CONFERENCE_TERMINATED' do + instance.call_ended_reason = Freeclimb::CallEndedReason::CONFERENCE_TERMINATED + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::CONFERENCE_TERMINATED) + end + it 'assigns value CONFERENCE_EMPTIED' do + instance.call_ended_reason = Freeclimb::CallEndedReason::CONFERENCE_EMPTIED + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::CONFERENCE_EMPTIED) + end + it 'assigns value REMOVED_FROM_CONFERENCE' do + instance.call_ended_reason = Freeclimb::CallEndedReason::REMOVED_FROM_CONFERENCE + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::REMOVED_FROM_CONFERENCE) + end + it 'assigns value MACHINE_DETECTED' do + instance.call_ended_reason = Freeclimb::CallEndedReason::MACHINE_DETECTED + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::MACHINE_DETECTED) + end + it 'assigns value WEBHOOK_FAILED' do + instance.call_ended_reason = Freeclimb::CallEndedReason::WEBHOOK_FAILED + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::WEBHOOK_FAILED) + end + it 'assigns value WEBHOOK_INVALID_RESPONSE' do + instance.call_ended_reason = Freeclimb::CallEndedReason::WEBHOOK_INVALID_RESPONSE + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::WEBHOOK_INVALID_RESPONSE) + end + it 'assigns value VOICE_DISABLED' do + instance.call_ended_reason = Freeclimb::CallEndedReason::VOICE_DISABLED + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::VOICE_DISABLED) + end + it 'assigns value CONFIG_ERROR_NO_APPLICATION' do + instance.call_ended_reason = Freeclimb::CallEndedReason::CONFIG_ERROR_NO_APPLICATION + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::CONFIG_ERROR_NO_APPLICATION) + end + it 'assigns value CONFIG_ERROR_NO_VOICE_URL' do + instance.call_ended_reason = Freeclimb::CallEndedReason::CONFIG_ERROR_NO_VOICE_URL + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::CONFIG_ERROR_NO_VOICE_URL) + end + it 'assigns value MAX_REDIRECTS_ERROR' do + instance.call_ended_reason = Freeclimb::CallEndedReason::MAX_REDIRECTS_ERROR + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::MAX_REDIRECTS_ERROR) + end + it 'assigns value PERCL_PROCESSING_ERROR' do + instance.call_ended_reason = Freeclimb::CallEndedReason::PERCL_PROCESSING_ERROR + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::PERCL_PROCESSING_ERROR) + end + it 'assigns value INTERNAL_ERROR' do + instance.call_ended_reason = Freeclimb::CallEndedReason::INTERNAL_ERROR + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::INTERNAL_ERROR) + end + it 'assigns value GRPC_HANGUP' do + instance.call_ended_reason = Freeclimb::CallEndedReason::GRPC_HANGUP + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::GRPC_HANGUP) + end + it 'assigns value MAX_DURATION' do + instance.call_ended_reason = Freeclimb::CallEndedReason::MAX_DURATION + expect(instance.call_ended_reason).to eq(Freeclimb::CallEndedReason::MAX_DURATION) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::CallStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + call_ended_reason: Freeclimb::CallEndedReason::BUSY, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::CallStatusWebhook' do + expect { instance = Freeclimb::CallStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + call_ended_reason: Freeclimb::CallEndedReason::BUSY, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::CallStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + call_ended_reason: Freeclimb::CallEndedReason::BUSY, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::CallStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + call_ended_reason: Freeclimb::CallEndedReason::BUSY, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::CallStatusWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::CallStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + call_ended_reason: Freeclimb::CallEndedReason::BUSY, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + instance_2 = Freeclimb::CallStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + call_ended_reason: Freeclimb::CallEndedReason::BUSY, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::CallStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + call_ended_reason: Freeclimb::CallEndedReason::BUSY, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + instance_2 = Freeclimb::CallStatusWebhook.new( + request_type: "ST", + + call_id: "ST", + + account_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + call_ended_reason: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::CallStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + call_ended_reason: Freeclimb::CallEndedReason::BUSY, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::CallStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + call_ended_reason: Freeclimb::CallEndedReason::BUSY, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + instance_2 = Freeclimb::CallStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + call_ended_reason: Freeclimb::CallEndedReason::BUSY, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::CallStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + call_ended_reason: Freeclimb::CallEndedReason::BUSY, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::CallStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + call_ended_reason: Freeclimb::CallEndedReason::BUSY, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::CallStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + call_ended_reason: Freeclimb::CallEndedReason::BUSY, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::CallStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + call_ended_reason: Freeclimb::CallEndedReason::BUSY, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + instance_2 = Freeclimb::CallStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + call_ended_reason: Freeclimb::CallEndedReason::BUSY, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::CallStatusWebhook.new( + request_type: "TS", + + + call_id: "TS", + + + account_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + call_ended_reason: Freeclimb::CallEndedReason::BUSY, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns call_ended_reason in the form of hash' do + expect(instance._to_hash(instance.call_ended_reason)).to eq(instance.call_ended_reason) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + end + +end diff --git a/spec/models/capabilities_spec.rb b/spec/models/capabilities_spec.rb index 2f236470..5c712b3f 100644 --- a/spec/models/capabilities_spec.rb +++ b/spec/models/capabilities_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -68,33 +68,48 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::Capabilities.new( - voice: true, - sms: true, - toll_free: true, - ten_dlc: true, - short_code: true, - )}.not_to raise_error() + expect { instance = Freeclimb::Capabilities.new( + voice: true, + + sms: true, + + toll_free: true, + + ten_dlc: true, + + short_code: true, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::Capabilities' do - expect{instance = Freeclimb::Capabilities.new( - voice: true, - sms: true, - toll_free: true, - ten_dlc: true, - short_code: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Capabilities.new( + voice: true, + + sms: true, + + toll_free: true, + + ten_dlc: true, + + short_code: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::Capabilities.new( - voice: true, - sms: true, - toll_free: true, - ten_dlc: true, - short_code: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Capabilities.new( + voice: true, + + sms: true, + + toll_free: true, + + ten_dlc: true, + + short_code: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -102,10 +117,15 @@ it 'checks if properties are valid' do instance = Freeclimb::Capabilities.new( voice: true, + sms: true, + toll_free: true, + ten_dlc: true, + short_code: true, + ) expect(instance.valid?).to eq(true) end @@ -125,17 +145,27 @@ obj = Object.new() instance_1 = Freeclimb::Capabilities.new( voice: true, + sms: true, + toll_free: true, + ten_dlc: true, + short_code: true, + ) instance_2 = Freeclimb::Capabilities.new( voice: true, + sms: true, + toll_free: true, + ten_dlc: true, + short_code: true, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -143,17 +173,27 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::Capabilities.new( voice: true, + sms: true, + toll_free: true, + ten_dlc: true, + short_code: true, + ) instance_2 = Freeclimb::Capabilities.new( voice: false, + sms: false, + toll_free: false, + ten_dlc: false, + short_code: false, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -163,12 +203,17 @@ it 'calculates hash code' do instance = Freeclimb::Capabilities.new( voice: true, + sms: true, + toll_free: true, + ten_dlc: true, + short_code: true, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -176,12 +221,29 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::Capabilities.new( voice: true, + sms: true, + toll_free: true, + ten_dlc: true, + short_code: true, + ) - instance_2 = Freeclimb::Capabilities.new + instance_2 = Freeclimb::Capabilities.new( + voice: true, + + sms: true, + + toll_free: true, + + ten_dlc: true, + + short_code: true, + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -189,10 +251,15 @@ describe 'test method "_deserialize"' do instance = Freeclimb::Capabilities.new( voice: true, + sms: true, + toll_free: true, + ten_dlc: true, + short_code: true, + ) it 'deserializes the data of voice' do expect(instance._deserialize("Boolean", instance.voice)).to be_a_kind_of(TrueClass) @@ -215,10 +282,15 @@ it 'returns the string representation of the object' do instance = Freeclimb::Capabilities.new( voice: true, + sms: true, + toll_free: true, + ten_dlc: true, + short_code: true, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -228,10 +300,15 @@ it 'returns the object in the form of hash' do instance = Freeclimb::Capabilities.new( voice: true, + sms: true, + toll_free: true, + ten_dlc: true, + short_code: true, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -239,17 +316,27 @@ obj = Object.new() instance_1 = Freeclimb::Capabilities.new( voice: true, + sms: true, + toll_free: true, + ten_dlc: true, + short_code: true, + ) instance_2 = Freeclimb::Capabilities.new( voice: true, + sms: true, + toll_free: true, + ten_dlc: true, + short_code: true, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -258,14 +345,19 @@ describe 'test method "_to_hash"' do instance = Freeclimb::Capabilities.new( voice: true, + sms: true, + toll_free: true, + ten_dlc: true, + short_code: true, + ) it 'returns voice in the form of hash' do expect(instance._to_hash(instance.voice)).to eq(instance.voice) diff --git a/spec/models/completion_request_spec.rb b/spec/models/completion_request_spec.rb index 402d44b0..8b458870 100644 --- a/spec/models/completion_request_spec.rb +++ b/spec/models/completion_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -32,27 +32,30 @@ expect(instance.query).to eq("T" * 2000) end it 'should not assign a value over maxLength' do - expect{instance.query = "T" * (2000 + 1)}.to raise_error(ArgumentError) + expect { instance.query = "T" * (2000 + 1) }.to raise_error(ArgumentError) end end describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::CompletionRequest.new( - query: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::CompletionRequest.new( + query: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::CompletionRequest' do - expect{instance = Freeclimb::CompletionRequest.new( - query: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::CompletionRequest.new( + query: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::CompletionRequest.new( - query: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::CompletionRequest.new( + query: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -60,6 +63,7 @@ it 'checks if properties are valid' do instance = Freeclimb::CompletionRequest.new( query: "TS", + ) expect(instance.valid?).to eq(true) end @@ -79,9 +83,11 @@ obj = Object.new() instance_1 = Freeclimb::CompletionRequest.new( query: "TS", + ) instance_2 = Freeclimb::CompletionRequest.new( query: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -89,9 +95,11 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::CompletionRequest.new( query: "TS", + ) instance_2 = Freeclimb::CompletionRequest.new( query: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -101,8 +109,9 @@ it 'calculates hash code' do instance = Freeclimb::CompletionRequest.new( query: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -110,8 +119,13 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::CompletionRequest.new( query: "TS", + ) - instance_2 = Freeclimb::CompletionRequest.new + instance_2 = Freeclimb::CompletionRequest.new( + query: "TS", + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -119,6 +133,7 @@ describe 'test method "_deserialize"' do instance = Freeclimb::CompletionRequest.new( query: "TS", + ) it 'deserializes the data of query' do expect(instance._deserialize("String", instance.query)).to be_a_kind_of(String) @@ -129,6 +144,7 @@ it 'returns the string representation of the object' do instance = Freeclimb::CompletionRequest.new( query: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -138,6 +154,7 @@ it 'returns the object in the form of hash' do instance = Freeclimb::CompletionRequest.new( query: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -145,9 +162,11 @@ obj = Object.new() instance_1 = Freeclimb::CompletionRequest.new( query: "TS", + ) instance_2 = Freeclimb::CompletionRequest.new( query: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -156,6 +175,7 @@ describe 'test method "_to_hash"' do instance = Freeclimb::CompletionRequest.new( query: "TS", + ) it 'returns query in the form of hash' do expect(instance._to_hash(instance.query)).to eq(instance.query) diff --git a/spec/models/completion_result_spec.rb b/spec/models/completion_result_spec.rb index ea0b86c5..d98bcf3e 100644 --- a/spec/models/completion_result_spec.rb +++ b/spec/models/completion_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -36,41 +36,44 @@ describe 'test attribute "status"' do - it 'assigns value success' do - instance.status = "success" - expect(instance.status).to eq("success") + it 'assigns value SUCCESS' do + instance.status = Freeclimb::CompletionResultStatus::SUCCESS + expect(instance.status).to eq(Freeclimb::CompletionResultStatus::SUCCESS) end - it 'assigns value no_context' do - instance.status = "no_context" - expect(instance.status).to eq("no_context") - end - - it 'throws error on invalid enum' do - instance = Freeclimb::CompletionResult.new - expect{instance.status = "INVALID_ENUM"}.to raise_error(ArgumentError) + it 'assigns value NO_CONTEXT' do + instance.status = Freeclimb::CompletionResultStatus::NO_CONTEXT + expect(instance.status).to eq(Freeclimb::CompletionResultStatus::NO_CONTEXT) end end - describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::CompletionResult.new( - response: "TS", - status: "success", - )}.not_to raise_error() + expect { instance = Freeclimb::CompletionResult.new( + response: "TS", + + + status: Freeclimb::CompletionResultStatus::SUCCESS, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::CompletionResult' do - expect{instance = Freeclimb::CompletionResult.new( - response: "TS", - status: "success", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::CompletionResult.new( + response: "TS", + + + status: Freeclimb::CompletionResultStatus::SUCCESS, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::CompletionResult.new( - response: "TS", - status: "success", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::CompletionResult.new( + response: "TS", + + + status: Freeclimb::CompletionResultStatus::SUCCESS, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -78,7 +81,10 @@ it 'checks if properties are valid' do instance = Freeclimb::CompletionResult.new( response: "TS", - status: "success", + + + status: Freeclimb::CompletionResultStatus::SUCCESS, + ) expect(instance.valid?).to eq(true) end @@ -98,11 +104,17 @@ obj = Object.new() instance_1 = Freeclimb::CompletionResult.new( response: "TS", - status: "success", + + + status: Freeclimb::CompletionResultStatus::SUCCESS, + ) instance_2 = Freeclimb::CompletionResult.new( response: "TS", - status: "success", + + + status: Freeclimb::CompletionResultStatus::SUCCESS, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -110,11 +122,17 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::CompletionResult.new( response: "TS", - status: "success", + + + status: Freeclimb::CompletionResultStatus::SUCCESS, + ) instance_2 = Freeclimb::CompletionResult.new( response: "ST", - status: "success", + + + status: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -124,9 +142,12 @@ it 'calculates hash code' do instance = Freeclimb::CompletionResult.new( response: "TS", - status: "success", + + + status: Freeclimb::CompletionResultStatus::SUCCESS, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -134,9 +155,19 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::CompletionResult.new( response: "TS", - status: "success", + + + status: Freeclimb::CompletionResultStatus::SUCCESS, + + ) + instance_2 = Freeclimb::CompletionResult.new( + response: "TS", + + + status: Freeclimb::CompletionResultStatus::SUCCESS, + ) - instance_2 = Freeclimb::CompletionResult.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -144,21 +175,24 @@ describe 'test method "_deserialize"' do instance = Freeclimb::CompletionResult.new( response: "TS", - status: "success", + + + status: Freeclimb::CompletionResultStatus::SUCCESS, + ) it 'deserializes the data of response' do expect(instance._deserialize("String", instance.response)).to be_a_kind_of(String) end - it 'deserializes the data of status' do - expect(instance._deserialize("String", instance.status)).to be_a_kind_of(String) - end end describe 'test method "to_s"' do it 'returns the string representation of the object' do instance = Freeclimb::CompletionResult.new( response: "TS", - status: "success", + + + status: Freeclimb::CompletionResultStatus::SUCCESS, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -168,7 +202,10 @@ it 'returns the object in the form of hash' do instance = Freeclimb::CompletionResult.new( response: "TS", - status: "success", + + + status: Freeclimb::CompletionResultStatus::SUCCESS, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -176,11 +213,17 @@ obj = Object.new() instance_1 = Freeclimb::CompletionResult.new( response: "TS", - status: "success", + + + status: Freeclimb::CompletionResultStatus::SUCCESS, + ) instance_2 = Freeclimb::CompletionResult.new( response: "TS", - status: "success", + + + status: Freeclimb::CompletionResultStatus::SUCCESS, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -189,8 +232,11 @@ describe 'test method "_to_hash"' do instance = Freeclimb::CompletionResult.new( response: "TS", + - status: "success", + + status: Freeclimb::CompletionResultStatus::SUCCESS, + ) it 'returns response in the form of hash' do expect(instance._to_hash(instance.response)).to eq(instance.response) diff --git a/spec/models/completion_result_status_spec.rb b/spec/models/completion_result_status_spec.rb new file mode 100644 index 00000000..76cb8e7f --- /dev/null +++ b/spec/models/completion_result_status_spec.rb @@ -0,0 +1,61 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::CompletionResultStatus +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::CompletionResultStatus do + let(:instance) { Freeclimb::CompletionResultStatus.new } + + describe 'test an instance of CompletionResultStatus' do + it 'should create an instance of CompletionResultStatus' do + expect(instance).to be_instance_of(Freeclimb::CompletionResultStatus) + end + end + + describe 'test attribute "SUCCESS"' do + it 'should work' do + expect { Freeclimb::CompletionResultStatus::SUCCESS = "success" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CompletionResultStatus::SUCCESS + calculatedValue = Freeclimb::CompletionResultStatus::build_from_hash("success") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "success" + calculatedValue = Freeclimb::CompletionResultStatus::SUCCESS + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "NO_CONTEXT"' do + it 'should work' do + expect { Freeclimb::CompletionResultStatus::NO_CONTEXT = "no_context" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::CompletionResultStatus::NO_CONTEXT + calculatedValue = Freeclimb::CompletionResultStatus::build_from_hash("no_context") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "no_context" + calculatedValue = Freeclimb::CompletionResultStatus::NO_CONTEXT + expect(expectedValue).to eq(calculatedValue) + end + end + +end diff --git a/spec/models/conference_list_spec.rb b/spec/models/conference_list_spec.rb index 45ff8007..ebf60d5d 100644 --- a/spec/models/conference_list_spec.rb +++ b/spec/models/conference_list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,42 +104,66 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::ConferenceList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - conferences: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::ConferenceList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + conferences: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::ConferenceList' do - expect{instance = Freeclimb::ConferenceList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - conferences: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::ConferenceList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + conferences: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::ConferenceList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - conferences: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::ConferenceList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + conferences: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -147,13 +171,21 @@ it 'checks if properties are valid' do instance = Freeclimb::ConferenceList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + conferences: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -173,25 +205,39 @@ obj = Object.new() instance_1 = Freeclimb::ConferenceList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - conferences: Freeclimb::ConferenceResult.new(), + conferences: [], + ) instance_2 = Freeclimb::ConferenceList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - conferences: Freeclimb::ConferenceResult.new(), + conferences: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,25 +245,39 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::ConferenceList.new( total: 2, + start: 2, + _end: 2, + page: 2, + num_pages: 2, + page_size: 2, + next_page_uri: "TS", - conferences: Freeclimb::ConferenceResult.new(), + conferences: [], + ) instance_2 = Freeclimb::ConferenceList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "ST", - conferences: Freeclimb::ConferenceResult.new(), + conferences: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -227,15 +287,23 @@ it 'calculates hash code' do instance = Freeclimb::ConferenceList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + conferences: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -243,15 +311,41 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::ConferenceList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + conferences: Array.new(), + ) - instance_2 = Freeclimb::ConferenceList.new + instance_2 = Freeclimb::ConferenceList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + conferences: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -259,13 +353,21 @@ describe 'test method "_deserialize"' do instance = Freeclimb::ConferenceList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + conferences: Array.new(), + ) it 'deserializes the data of total' do expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) @@ -297,13 +399,21 @@ it 'returns the string representation of the object' do instance = Freeclimb::ConferenceList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + conferences: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -313,13 +423,21 @@ it 'returns the object in the form of hash' do instance = Freeclimb::ConferenceList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + conferences: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -327,23 +445,39 @@ obj = Object.new() instance_1 = Freeclimb::ConferenceList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + conferences: Array.new(), + ) instance_2 = Freeclimb::ConferenceList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + conferences: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -352,20 +486,28 @@ describe 'test method "_to_hash"' do instance = Freeclimb::ConferenceList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + conferences: Array.new(), + ) it 'returns total in the form of hash' do expect(instance._to_hash(instance.total)).to eq(instance.total) diff --git a/spec/models/conference_participant_list_spec.rb b/spec/models/conference_participant_list_spec.rb index d9df027e..731e755d 100644 --- a/spec/models/conference_participant_list_spec.rb +++ b/spec/models/conference_participant_list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,42 +104,66 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::ConferenceParticipantList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - participants: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::ConferenceParticipantList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + participants: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::ConferenceParticipantList' do - expect{instance = Freeclimb::ConferenceParticipantList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - participants: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::ConferenceParticipantList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + participants: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::ConferenceParticipantList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - participants: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::ConferenceParticipantList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + participants: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -147,13 +171,21 @@ it 'checks if properties are valid' do instance = Freeclimb::ConferenceParticipantList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + participants: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -173,25 +205,39 @@ obj = Object.new() instance_1 = Freeclimb::ConferenceParticipantList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - participants: Freeclimb::ConferenceParticipantResult.new(), + participants: [], + ) instance_2 = Freeclimb::ConferenceParticipantList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - participants: Freeclimb::ConferenceParticipantResult.new(), + participants: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,25 +245,39 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::ConferenceParticipantList.new( total: 2, + start: 2, + _end: 2, + page: 2, + num_pages: 2, + page_size: 2, + next_page_uri: "TS", - participants: Freeclimb::ConferenceParticipantResult.new(), + participants: [], + ) instance_2 = Freeclimb::ConferenceParticipantList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "ST", - participants: Freeclimb::ConferenceParticipantResult.new(), + participants: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -227,15 +287,23 @@ it 'calculates hash code' do instance = Freeclimb::ConferenceParticipantList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + participants: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -243,15 +311,41 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::ConferenceParticipantList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + participants: Array.new(), + ) - instance_2 = Freeclimb::ConferenceParticipantList.new + instance_2 = Freeclimb::ConferenceParticipantList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + participants: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -259,13 +353,21 @@ describe 'test method "_deserialize"' do instance = Freeclimb::ConferenceParticipantList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + participants: Array.new(), + ) it 'deserializes the data of total' do expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) @@ -297,13 +399,21 @@ it 'returns the string representation of the object' do instance = Freeclimb::ConferenceParticipantList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + participants: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -313,13 +423,21 @@ it 'returns the object in the form of hash' do instance = Freeclimb::ConferenceParticipantList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + participants: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -327,23 +445,39 @@ obj = Object.new() instance_1 = Freeclimb::ConferenceParticipantList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + participants: Array.new(), + ) instance_2 = Freeclimb::ConferenceParticipantList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + participants: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -352,20 +486,28 @@ describe 'test method "_to_hash"' do instance = Freeclimb::ConferenceParticipantList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + participants: Array.new(), + ) it 'returns total in the form of hash' do expect(instance._to_hash(instance.total)).to eq(instance.total) diff --git a/spec/models/conference_participant_result_spec.rb b/spec/models/conference_participant_result_spec.rb index 8519ff63..d3a0e6e7 100644 --- a/spec/models/conference_participant_result_spec.rb +++ b/spec/models/conference_participant_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -100,6 +100,14 @@ end end + describe 'test attribute "dtmf_pass_through"' do + it 'should work' do + instance.dtmf_pass_through = false + expect(instance.dtmf_pass_through).to eq(false) + + end + end + describe 'test attribute "start_conf_on_enter"' do it 'should work' do instance.start_conf_on_enter = false @@ -110,48 +118,84 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::ConferenceParticipantResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - account_id: "TS", - conference_id: "TS", - call_id: "TS", - talk: true, - listen: true, - start_conf_on_enter: true, - )}.not_to raise_error() + expect { instance = Freeclimb::ConferenceParticipantResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + conference_id: "TS", + + call_id: "TS", + + talk: true, + + listen: true, + + dtmf_pass_through: true, + + start_conf_on_enter: true, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::ConferenceParticipantResult' do - expect{instance = Freeclimb::ConferenceParticipantResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - account_id: "TS", - conference_id: "TS", - call_id: "TS", - talk: true, - listen: true, - start_conf_on_enter: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::ConferenceParticipantResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + conference_id: "TS", + + call_id: "TS", + + talk: true, + + listen: true, + + dtmf_pass_through: true, + + start_conf_on_enter: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::ConferenceParticipantResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - account_id: "TS", - conference_id: "TS", - call_id: "TS", - talk: true, - listen: true, - start_conf_on_enter: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::ConferenceParticipantResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + conference_id: "TS", + + call_id: "TS", + + talk: true, + + listen: true, + + dtmf_pass_through: true, + + start_conf_on_enter: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -159,15 +203,27 @@ it 'checks if properties are valid' do instance = Freeclimb::ConferenceParticipantResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + conference_id: "TS", + call_id: "TS", + talk: true, + listen: true, + + dtmf_pass_through: true, + start_conf_on_enter: true, + ) expect(instance.valid?).to eq(true) end @@ -187,27 +243,51 @@ obj = Object.new() instance_1 = Freeclimb::ConferenceParticipantResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + conference_id: "TS", + call_id: "TS", + talk: true, + listen: true, + + dtmf_pass_through: true, + start_conf_on_enter: true, + ) instance_2 = Freeclimb::ConferenceParticipantResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + conference_id: "TS", + call_id: "TS", + talk: true, + listen: true, + + dtmf_pass_through: true, + start_conf_on_enter: true, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -215,27 +295,51 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::ConferenceParticipantResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 2, + account_id: "TS", + conference_id: "TS", + call_id: "TS", + talk: true, + listen: true, + + dtmf_pass_through: true, + start_conf_on_enter: true, + ) instance_2 = Freeclimb::ConferenceParticipantResult.new( uri: "ST", + date_created: "ST", + date_updated: "ST", + revision: 1, + account_id: "ST", + conference_id: "ST", + call_id: "ST", + talk: false, + listen: false, + + dtmf_pass_through: false, + start_conf_on_enter: false, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -245,17 +349,29 @@ it 'calculates hash code' do instance = Freeclimb::ConferenceParticipantResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + conference_id: "TS", + call_id: "TS", + talk: true, + listen: true, + + dtmf_pass_through: true, + start_conf_on_enter: true, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -263,17 +379,53 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::ConferenceParticipantResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + conference_id: "TS", + call_id: "TS", + talk: true, + listen: true, + + dtmf_pass_through: true, + start_conf_on_enter: true, + ) - instance_2 = Freeclimb::ConferenceParticipantResult.new + instance_2 = Freeclimb::ConferenceParticipantResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + conference_id: "TS", + + call_id: "TS", + + talk: true, + + listen: true, + + dtmf_pass_through: true, + + start_conf_on_enter: true, + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -281,15 +433,27 @@ describe 'test method "_deserialize"' do instance = Freeclimb::ConferenceParticipantResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + conference_id: "TS", + call_id: "TS", + talk: true, + listen: true, + + dtmf_pass_through: true, + start_conf_on_enter: true, + ) it 'deserializes the data of uri' do expect(instance._deserialize("String", instance.uri)).to be_a_kind_of(String) @@ -318,6 +482,9 @@ it 'deserializes the data of listen' do expect(instance._deserialize("Boolean", instance.listen)).to be_a_kind_of(TrueClass) end + it 'deserializes the data of dtmf_pass_through' do + expect(instance._deserialize("Boolean", instance.dtmf_pass_through)).to be_a_kind_of(TrueClass) + end it 'deserializes the data of start_conf_on_enter' do expect(instance._deserialize("Boolean", instance.start_conf_on_enter)).to be_a_kind_of(TrueClass) end @@ -327,15 +494,27 @@ it 'returns the string representation of the object' do instance = Freeclimb::ConferenceParticipantResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + conference_id: "TS", + call_id: "TS", + talk: true, + listen: true, + + dtmf_pass_through: true, + start_conf_on_enter: true, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -345,15 +524,27 @@ it 'returns the object in the form of hash' do instance = Freeclimb::ConferenceParticipantResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + conference_id: "TS", + call_id: "TS", + talk: true, + listen: true, + + dtmf_pass_through: true, + start_conf_on_enter: true, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -361,27 +552,51 @@ obj = Object.new() instance_1 = Freeclimb::ConferenceParticipantResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + conference_id: "TS", + call_id: "TS", + talk: true, + listen: true, + + dtmf_pass_through: true, + start_conf_on_enter: true, + ) instance_2 = Freeclimb::ConferenceParticipantResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + conference_id: "TS", + call_id: "TS", + talk: true, + listen: true, + + dtmf_pass_through: true, + start_conf_on_enter: true, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -390,24 +605,37 @@ describe 'test method "_to_hash"' do instance = Freeclimb::ConferenceParticipantResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + conference_id: "TS", + call_id: "TS", + talk: true, + listen: true, + + + dtmf_pass_through: true, + start_conf_on_enter: true, + ) it 'returns uri in the form of hash' do expect(instance._to_hash(instance.uri)).to eq(instance.uri) @@ -436,6 +664,9 @@ it 'returns listen in the form of hash' do expect(instance._to_hash(instance.listen)).to eq(instance.listen) end + it 'returns dtmf_pass_through in the form of hash' do + expect(instance._to_hash(instance.dtmf_pass_through)).to eq(instance.dtmf_pass_through) + end it 'returns start_conf_on_enter in the form of hash' do expect(instance._to_hash(instance.start_conf_on_enter)).to eq(instance.start_conf_on_enter) end diff --git a/spec/models/conference_recording_status_webhook_spec.rb b/spec/models/conference_recording_status_webhook_spec.rb new file mode 100644 index 00000000..82a57e9e --- /dev/null +++ b/spec/models/conference_recording_status_webhook_spec.rb @@ -0,0 +1,866 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::ConferenceRecordingStatusWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::ConferenceRecordingStatusWebhook do + let(:instance) { Freeclimb::ConferenceRecordingStatusWebhook.new } + + describe 'test an instance of ConferenceRecordingStatusWebhook' do + it 'should create an instance of ConferenceRecordingStatusWebhook' do + expect(instance).to be_instance_of(Freeclimb::ConferenceRecordingStatusWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of ConferenceRecordingStatusWebhook' do + payload = '{ "requestType": "conferenceRecordingStatus" }' + expect(Freeclimb::ConferenceRecordingStatusWebhook.deserialize(payload)).to be_instance_of(Freeclimb::ConferenceRecordingStatusWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "status"' do + it 'assigns value EMPTY' do + instance.status = Freeclimb::ConferenceStatus::EMPTY + expect(instance.status).to eq(Freeclimb::ConferenceStatus::EMPTY) + end + it 'assigns value POPULATED' do + instance.status = Freeclimb::ConferenceStatus::POPULATED + expect(instance.status).to eq(Freeclimb::ConferenceStatus::POPULATED) + end + it 'assigns value IN_PROGRESS' do + instance.status = Freeclimb::ConferenceStatus::IN_PROGRESS + expect(instance.status).to eq(Freeclimb::ConferenceStatus::IN_PROGRESS) + end + it 'assigns value TERMINATED' do + instance.status = Freeclimb::ConferenceStatus::TERMINATED + expect(instance.status).to eq(Freeclimb::ConferenceStatus::TERMINATED) + end + end + describe 'test attribute "recording_url"' do + it 'should work' do + instance.recording_url = "TEST_STRING" + expect(instance.recording_url).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_id"' do + it 'should work' do + instance.recording_id = "TEST_STRING" + expect(instance.recording_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_duration_sec"' do + it 'should work' do + + + instance.recording_duration_sec = 1 + expect(instance.recording_duration_sec).to eq(1) + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::ConferenceRecordingStatusWebhook' do + expect { instance = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::ConferenceRecordingStatusWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + instance_2 = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 2, + + ) + instance_2 = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "ST", + + call_id: "ST", + + account_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + + status: nil, + + recording_url: "ST", + + recording_id: "ST", + + recording_duration_sec: 1, + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + instance_2 = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_url' do + expect(instance._deserialize("String", instance.recording_url)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_id' do + expect(instance._deserialize("String", instance.recording_id)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_duration_sec' do + expect(instance._deserialize("Integer", instance.recording_duration_sec)).to be_a_kind_of(Integer) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + instance_2 = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::ConferenceRecordingStatusWebhook.new( + request_type: "TS", + + + call_id: "TS", + + + account_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + + + status: Freeclimb::ConferenceStatus::EMPTY, + + + recording_url: "TS", + + + recording_id: "TS", + + + recording_duration_sec: 1, + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + it 'returns status in the form of hash' do + expect(instance._to_hash(instance.status)).to eq(instance.status) + end + it 'returns recording_url in the form of hash' do + expect(instance._to_hash(instance.recording_url)).to eq(instance.recording_url) + end + it 'returns recording_id in the form of hash' do + expect(instance._to_hash(instance.recording_id)).to eq(instance.recording_id) + end + it 'returns recording_duration_sec in the form of hash' do + expect(instance._to_hash(instance.recording_duration_sec)).to eq(instance.recording_duration_sec) + end + end + +end diff --git a/spec/models/conference_result_spec.rb b/spec/models/conference_result_spec.rb index 1cdeca8f..b587c3eb 100644 --- a/spec/models/conference_result_spec.rb +++ b/spec/models/conference_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -103,7 +103,6 @@ expect(instance.play_beep).to eq(Freeclimb::PlayBeep::EXIT_ONLY) end end - describe 'test attribute "record"' do it 'should work' do instance.record = false @@ -131,7 +130,6 @@ expect(instance.status).to eq(Freeclimb::ConferenceStatus::TERMINATED) end end - describe 'test attribute "wait_url"' do it 'should work' do instance.wait_url = "TEST_STRING" @@ -167,60 +165,108 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::ConferenceResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - conference_id: "TS", - account_id: "TS", - _alias: "TS", - play_beep: "ALWAYS", - record: true, - status: "EMPTY", - wait_url: "TS", - action_url: "TS", - status_callback_url: "TS", - subresource_uris: Object.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::ConferenceResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + conference_id: "TS", + + account_id: "TS", + + _alias: "TS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + record: true, + + + status: Freeclimb::ConferenceStatus::EMPTY, + + wait_url: "TS", + + action_url: "TS", + + status_callback_url: "TS", + + subresource_uris: Object.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::ConferenceResult' do - expect{instance = Freeclimb::ConferenceResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - conference_id: "TS", - account_id: "TS", - _alias: "TS", - play_beep: "ALWAYS", - record: true, - status: "EMPTY", - wait_url: "TS", - action_url: "TS", - status_callback_url: "TS", - subresource_uris: Object.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::ConferenceResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + conference_id: "TS", + + account_id: "TS", + + _alias: "TS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + record: true, + + + status: Freeclimb::ConferenceStatus::EMPTY, + + wait_url: "TS", + + action_url: "TS", + + status_callback_url: "TS", + + subresource_uris: Object.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::ConferenceResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - conference_id: "TS", - account_id: "TS", - _alias: "TS", - play_beep: "ALWAYS", - record: true, - status: "EMPTY", - wait_url: "TS", - action_url: "TS", - status_callback_url: "TS", - subresource_uris: Object.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::ConferenceResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + conference_id: "TS", + + account_id: "TS", + + _alias: "TS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + record: true, + + + status: Freeclimb::ConferenceStatus::EMPTY, + + wait_url: "TS", + + action_url: "TS", + + status_callback_url: "TS", + + subresource_uris: Object.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -228,19 +274,35 @@ it 'checks if properties are valid' do instance = Freeclimb::ConferenceResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + conference_id: "TS", + account_id: "TS", + _alias: "TS", - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, - status: "EMPTY", + + + status: Freeclimb::ConferenceStatus::EMPTY, + wait_url: "TS", + action_url: "TS", + status_callback_url: "TS", + subresource_uris: Object.new(), + ) expect(instance.valid?).to eq(true) end @@ -260,39 +322,67 @@ obj = Object.new() instance_1 = Freeclimb::ConferenceResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + conference_id: "TS", + account_id: "TS", + _alias: "TS", - play_beep: Freeclimb::PlayBeep.new(), - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, - status: Freeclimb::ConferenceStatus.new(), - status: "EMPTY", + + + status: Freeclimb::ConferenceStatus::EMPTY, + wait_url: "TS", + action_url: "TS", + status_callback_url: "TS", + subresource_uris: obj, + ) instance_2 = Freeclimb::ConferenceResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + conference_id: "TS", + account_id: "TS", + _alias: "TS", - play_beep: Freeclimb::PlayBeep.new(), - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, - status: Freeclimb::ConferenceStatus.new(), - status: "EMPTY", + + + status: Freeclimb::ConferenceStatus::EMPTY, + wait_url: "TS", + action_url: "TS", + status_callback_url: "TS", + subresource_uris: obj, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -300,39 +390,67 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::ConferenceResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 2, + conference_id: "TS", + account_id: "TS", + _alias: "TS", - play_beep: Freeclimb::PlayBeep.new(), - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, - status: Freeclimb::ConferenceStatus.new(), - status: "EMPTY", + + + status: Freeclimb::ConferenceStatus::EMPTY, + wait_url: "TS", + action_url: "TS", + status_callback_url: "TS", + subresource_uris: Object.new(), + ) instance_2 = Freeclimb::ConferenceResult.new( uri: "ST", + date_created: "ST", + date_updated: "ST", + revision: 1, + conference_id: "ST", + account_id: "ST", + _alias: "ST", - play_beep: Freeclimb::PlayBeep.new(), - play_beep: "NEVER", + + + play_beep: nil, + record: false, - status: Freeclimb::ConferenceStatus.new(), - status: "POPULATED", + + + status: nil, + wait_url: "ST", + action_url: "ST", + status_callback_url: "ST", + subresource_uris: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -342,21 +460,37 @@ it 'calculates hash code' do instance = Freeclimb::ConferenceResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + conference_id: "TS", + account_id: "TS", + _alias: "TS", - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, - status: "EMPTY", + + + status: Freeclimb::ConferenceStatus::EMPTY, + wait_url: "TS", + action_url: "TS", + status_callback_url: "TS", + subresource_uris: Object.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -364,21 +498,69 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::ConferenceResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + conference_id: "TS", + account_id: "TS", + _alias: "TS", - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + record: true, + + + status: Freeclimb::ConferenceStatus::EMPTY, + + wait_url: "TS", + + action_url: "TS", + + status_callback_url: "TS", + + subresource_uris: Object.new(), + + ) + instance_2 = Freeclimb::ConferenceResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + conference_id: "TS", + + account_id: "TS", + + _alias: "TS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, - status: "EMPTY", + + + status: Freeclimb::ConferenceStatus::EMPTY, + wait_url: "TS", + action_url: "TS", + status_callback_url: "TS", + subresource_uris: Object.new(), + ) - instance_2 = Freeclimb::ConferenceResult.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -386,19 +568,35 @@ describe 'test method "_deserialize"' do instance = Freeclimb::ConferenceResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + conference_id: "TS", + account_id: "TS", + _alias: "TS", - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, - status: "EMPTY", + + + status: Freeclimb::ConferenceStatus::EMPTY, + wait_url: "TS", + action_url: "TS", + status_callback_url: "TS", + subresource_uris: Object.new(), + ) it 'deserializes the data of uri' do expect(instance._deserialize("String", instance.uri)).to be_a_kind_of(String) @@ -442,19 +640,35 @@ it 'returns the string representation of the object' do instance = Freeclimb::ConferenceResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + conference_id: "TS", + account_id: "TS", + _alias: "TS", - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, - status: "EMPTY", + + + status: Freeclimb::ConferenceStatus::EMPTY, + wait_url: "TS", + action_url: "TS", + status_callback_url: "TS", + subresource_uris: Object.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -464,19 +678,35 @@ it 'returns the object in the form of hash' do instance = Freeclimb::ConferenceResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + conference_id: "TS", + account_id: "TS", + _alias: "TS", - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, - status: "EMPTY", + + + status: Freeclimb::ConferenceStatus::EMPTY, + wait_url: "TS", + action_url: "TS", + status_callback_url: "TS", + subresource_uris: Object.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -484,35 +714,67 @@ obj = Object.new() instance_1 = Freeclimb::ConferenceResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + conference_id: "TS", + account_id: "TS", + _alias: "TS", - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, - status: "EMPTY", + + + status: Freeclimb::ConferenceStatus::EMPTY, + wait_url: "TS", + action_url: "TS", + status_callback_url: "TS", + subresource_uris: obj, + ) instance_2 = Freeclimb::ConferenceResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + conference_id: "TS", + account_id: "TS", + _alias: "TS", - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, - status: "EMPTY", + + + status: Freeclimb::ConferenceStatus::EMPTY, + wait_url: "TS", + action_url: "TS", + status_callback_url: "TS", + subresource_uris: obj, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -521,32 +783,48 @@ describe 'test method "_to_hash"' do instance = Freeclimb::ConferenceResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + conference_id: "TS", + account_id: "TS", + _alias: "TS", + - play_beep: "ALWAYS", + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + - status: "EMPTY", + + status: Freeclimb::ConferenceStatus::EMPTY, + wait_url: "TS", + action_url: "TS", + status_callback_url: "TS", + subresource_uris: Object.new(), + ) it 'returns uri in the form of hash' do expect(instance._to_hash(instance.uri)).to eq(instance.uri) diff --git a/spec/models/conference_status_spec.rb b/spec/models/conference_status_spec.rb index b9b2b094..12cdd74e 100644 --- a/spec/models/conference_status_spec.rb +++ b/spec/models/conference_status_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/conference_status_webhook_spec.rb b/spec/models/conference_status_webhook_spec.rb new file mode 100644 index 00000000..0f6a5e1c --- /dev/null +++ b/spec/models/conference_status_webhook_spec.rb @@ -0,0 +1,866 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::ConferenceStatusWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::ConferenceStatusWebhook do + let(:instance) { Freeclimb::ConferenceStatusWebhook.new } + + describe 'test an instance of ConferenceStatusWebhook' do + it 'should create an instance of ConferenceStatusWebhook' do + expect(instance).to be_instance_of(Freeclimb::ConferenceStatusWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of ConferenceStatusWebhook' do + payload = '{ "requestType": "conferenceStatus" }' + expect(Freeclimb::ConferenceStatusWebhook.deserialize(payload)).to be_instance_of(Freeclimb::ConferenceStatusWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "status"' do + it 'assigns value EMPTY' do + instance.status = Freeclimb::ConferenceStatus::EMPTY + expect(instance.status).to eq(Freeclimb::ConferenceStatus::EMPTY) + end + it 'assigns value POPULATED' do + instance.status = Freeclimb::ConferenceStatus::POPULATED + expect(instance.status).to eq(Freeclimb::ConferenceStatus::POPULATED) + end + it 'assigns value IN_PROGRESS' do + instance.status = Freeclimb::ConferenceStatus::IN_PROGRESS + expect(instance.status).to eq(Freeclimb::ConferenceStatus::IN_PROGRESS) + end + it 'assigns value TERMINATED' do + instance.status = Freeclimb::ConferenceStatus::TERMINATED + expect(instance.status).to eq(Freeclimb::ConferenceStatus::TERMINATED) + end + end + describe 'test attribute "recording_url"' do + it 'should work' do + instance.recording_url = "TEST_STRING" + expect(instance.recording_url).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_id"' do + it 'should work' do + instance.recording_id = "TEST_STRING" + expect(instance.recording_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_duration_sec"' do + it 'should work' do + + + instance.recording_duration_sec = 1 + expect(instance.recording_duration_sec).to eq(1) + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::ConferenceStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::ConferenceStatusWebhook' do + expect { instance = Freeclimb::ConferenceStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::ConferenceStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::ConferenceStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::ConferenceStatusWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::ConferenceStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + instance_2 = Freeclimb::ConferenceStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::ConferenceStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 2, + + ) + instance_2 = Freeclimb::ConferenceStatusWebhook.new( + request_type: "ST", + + call_id: "ST", + + account_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + + status: nil, + + recording_url: "ST", + + recording_id: "ST", + + recording_duration_sec: 1, + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::ConferenceStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::ConferenceStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + instance_2 = Freeclimb::ConferenceStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::ConferenceStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_url' do + expect(instance._deserialize("String", instance.recording_url)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_id' do + expect(instance._deserialize("String", instance.recording_id)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_duration_sec' do + expect(instance._deserialize("Integer", instance.recording_duration_sec)).to be_a_kind_of(Integer) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::ConferenceStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::ConferenceStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::ConferenceStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + instance_2 = Freeclimb::ConferenceStatusWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::ConferenceStatusWebhook.new( + request_type: "TS", + + + call_id: "TS", + + + account_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + + + status: Freeclimb::ConferenceStatus::EMPTY, + + + recording_url: "TS", + + + recording_id: "TS", + + + recording_duration_sec: 1, + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + it 'returns status in the form of hash' do + expect(instance._to_hash(instance.status)).to eq(instance.status) + end + it 'returns recording_url in the form of hash' do + expect(instance._to_hash(instance.recording_url)).to eq(instance.recording_url) + end + it 'returns recording_id in the form of hash' do + expect(instance._to_hash(instance.recording_id)).to eq(instance.recording_id) + end + it 'returns recording_duration_sec in the form of hash' do + expect(instance._to_hash(instance.recording_duration_sec)).to eq(instance.recording_duration_sec) + end + end + +end diff --git a/spec/models/create_conference_request_spec.rb b/spec/models/create_conference_request_spec.rb index 695b2c29..8e1f54b3 100644 --- a/spec/models/create_conference_request_spec.rb +++ b/spec/models/create_conference_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -53,7 +53,6 @@ expect(instance.play_beep).to eq(Freeclimb::PlayBeep::EXIT_ONLY) end end - describe 'test attribute "record"' do it 'should work' do instance.record = false @@ -80,33 +79,51 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::CreateConferenceRequest.new( - _alias: "TS", - play_beep: "ALWAYS", - record: true, - wait_url: "TS", - status_callback_url: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::CreateConferenceRequest.new( + _alias: "TS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + record: true, + + wait_url: "TS", + + status_callback_url: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::CreateConferenceRequest' do - expect{instance = Freeclimb::CreateConferenceRequest.new( - _alias: "TS", - play_beep: "ALWAYS", - record: true, - wait_url: "TS", - status_callback_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::CreateConferenceRequest.new( + _alias: "TS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + record: true, + + wait_url: "TS", + + status_callback_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::CreateConferenceRequest.new( - _alias: "TS", - play_beep: "ALWAYS", - record: true, - wait_url: "TS", - status_callback_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::CreateConferenceRequest.new( + _alias: "TS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + record: true, + + wait_url: "TS", + + status_callback_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -114,10 +131,16 @@ it 'checks if properties are valid' do instance = Freeclimb::CreateConferenceRequest.new( _alias: "TS", - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + wait_url: "TS", + status_callback_url: "TS", + ) expect(instance.valid?).to eq(true) end @@ -137,19 +160,29 @@ obj = Object.new() instance_1 = Freeclimb::CreateConferenceRequest.new( _alias: "TS", - play_beep: Freeclimb::PlayBeep.new(), - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + wait_url: "TS", + status_callback_url: "TS", + ) instance_2 = Freeclimb::CreateConferenceRequest.new( _alias: "TS", - play_beep: Freeclimb::PlayBeep.new(), - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + wait_url: "TS", + status_callback_url: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -157,19 +190,29 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::CreateConferenceRequest.new( _alias: "TS", - play_beep: Freeclimb::PlayBeep.new(), - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + wait_url: "TS", + status_callback_url: "TS", + ) instance_2 = Freeclimb::CreateConferenceRequest.new( _alias: "ST", - play_beep: Freeclimb::PlayBeep.new(), - play_beep: "NEVER", + + + play_beep: nil, + record: false, + wait_url: "ST", + status_callback_url: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -179,12 +222,18 @@ it 'calculates hash code' do instance = Freeclimb::CreateConferenceRequest.new( _alias: "TS", - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + wait_url: "TS", + status_callback_url: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -192,12 +241,31 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::CreateConferenceRequest.new( _alias: "TS", - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + record: true, + + wait_url: "TS", + + status_callback_url: "TS", + + ) + instance_2 = Freeclimb::CreateConferenceRequest.new( + _alias: "TS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + wait_url: "TS", + status_callback_url: "TS", + ) - instance_2 = Freeclimb::CreateConferenceRequest.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -205,10 +273,16 @@ describe 'test method "_deserialize"' do instance = Freeclimb::CreateConferenceRequest.new( _alias: "TS", - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + wait_url: "TS", + status_callback_url: "TS", + ) it 'deserializes the data of _alias' do expect(instance._deserialize("String", instance._alias)).to be_a_kind_of(String) @@ -228,10 +302,16 @@ it 'returns the string representation of the object' do instance = Freeclimb::CreateConferenceRequest.new( _alias: "TS", - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + wait_url: "TS", + status_callback_url: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -241,10 +321,16 @@ it 'returns the object in the form of hash' do instance = Freeclimb::CreateConferenceRequest.new( _alias: "TS", - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + wait_url: "TS", + status_callback_url: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -252,17 +338,29 @@ obj = Object.new() instance_1 = Freeclimb::CreateConferenceRequest.new( _alias: "TS", - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + wait_url: "TS", + status_callback_url: "TS", + ) instance_2 = Freeclimb::CreateConferenceRequest.new( _alias: "TS", - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + wait_url: "TS", + status_callback_url: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -271,14 +369,20 @@ describe 'test method "_to_hash"' do instance = Freeclimb::CreateConferenceRequest.new( _alias: "TS", + - play_beep: "ALWAYS", + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + wait_url: "TS", + status_callback_url: "TS", + ) it 'returns _alias in the form of hash' do expect(instance._to_hash(instance._alias)).to eq(instance._alias) diff --git a/spec/models/create_conference_spec.rb b/spec/models/create_conference_spec.rb index 55f79754..4b1391df 100644 --- a/spec/models/create_conference_spec.rb +++ b/spec/models/create_conference_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -61,7 +61,6 @@ expect(instance.play_beep).to eq(Freeclimb::PlayBeep::EXIT_ONLY) end end - describe 'test attribute "record"' do it 'should work' do instance.record = false @@ -88,36 +87,57 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::CreateConference.new( - action_url: "TS", - _alias: true, - play_beep: "ALWAYS", - record: true, - status_callback_url: "TS", - wait_url: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::CreateConference.new( + action_url: "TS", + + _alias: true, + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + record: true, + + status_callback_url: "TS", + + wait_url: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::CreateConference' do - expect{instance = Freeclimb::CreateConference.new( - action_url: "TS", - _alias: true, - play_beep: "ALWAYS", - record: true, - status_callback_url: "TS", - wait_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::CreateConference.new( + action_url: "TS", + + _alias: true, + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + record: true, + + status_callback_url: "TS", + + wait_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::CreateConference.new( - action_url: "TS", - _alias: true, - play_beep: "ALWAYS", - record: true, - status_callback_url: "TS", - wait_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::CreateConference.new( + action_url: "TS", + + _alias: true, + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + record: true, + + status_callback_url: "TS", + + wait_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -125,11 +145,18 @@ it 'checks if properties are valid' do instance = Freeclimb::CreateConference.new( action_url: "TS", + _alias: true, - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + status_callback_url: "TS", + wait_url: "TS", + ) expect(instance.valid?).to eq(true) end @@ -149,21 +176,33 @@ obj = Object.new() instance_1 = Freeclimb::CreateConference.new( action_url: "TS", + _alias: true, - play_beep: Freeclimb::PlayBeep.new(), - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + status_callback_url: "TS", + wait_url: "TS", + ) instance_2 = Freeclimb::CreateConference.new( action_url: "TS", + _alias: true, - play_beep: Freeclimb::PlayBeep.new(), - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + status_callback_url: "TS", + wait_url: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -171,21 +210,33 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::CreateConference.new( action_url: "TS", + _alias: true, - play_beep: Freeclimb::PlayBeep.new(), - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + status_callback_url: "TS", + wait_url: "TS", + ) instance_2 = Freeclimb::CreateConference.new( action_url: "ST", + _alias: false, - play_beep: Freeclimb::PlayBeep.new(), - play_beep: "NEVER", + + + play_beep: nil, + record: false, + status_callback_url: "ST", + wait_url: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -195,13 +246,20 @@ it 'calculates hash code' do instance = Freeclimb::CreateConference.new( action_url: "TS", + _alias: true, - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + status_callback_url: "TS", + wait_url: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -209,13 +267,35 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::CreateConference.new( action_url: "TS", + _alias: true, - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + status_callback_url: "TS", + wait_url: "TS", + ) - instance_2 = Freeclimb::CreateConference.new + instance_2 = Freeclimb::CreateConference.new( + action_url: "TS", + + _alias: true, + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + record: true, + + status_callback_url: "TS", + + wait_url: "TS", + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -223,11 +303,18 @@ describe 'test method "_deserialize"' do instance = Freeclimb::CreateConference.new( action_url: "TS", + _alias: true, - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + status_callback_url: "TS", + wait_url: "TS", + ) it 'deserializes the data of action_url' do expect(instance._deserialize("String", instance.action_url)).to be_a_kind_of(String) @@ -250,11 +337,18 @@ it 'returns the string representation of the object' do instance = Freeclimb::CreateConference.new( action_url: "TS", + _alias: true, - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + status_callback_url: "TS", + wait_url: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -264,11 +358,18 @@ it 'returns the object in the form of hash' do instance = Freeclimb::CreateConference.new( action_url: "TS", + _alias: true, - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + status_callback_url: "TS", + wait_url: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -276,19 +377,33 @@ obj = Object.new() instance_1 = Freeclimb::CreateConference.new( action_url: "TS", + _alias: true, - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + status_callback_url: "TS", + wait_url: "TS", + ) instance_2 = Freeclimb::CreateConference.new( action_url: "TS", + _alias: true, - play_beep: "ALWAYS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + status_callback_url: "TS", + wait_url: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -297,16 +412,23 @@ describe 'test method "_to_hash"' do instance = Freeclimb::CreateConference.new( action_url: "TS", + _alias: true, + - play_beep: "ALWAYS", + + play_beep: Freeclimb::PlayBeep::ALWAYS, + record: true, + status_callback_url: "TS", + wait_url: "TS", + ) it 'returns action_url in the form of hash' do expect(instance._to_hash(instance.action_url)).to eq(instance.action_url) diff --git a/spec/models/create_conference_webhook_spec.rb b/spec/models/create_conference_webhook_spec.rb new file mode 100644 index 00000000..95532a72 --- /dev/null +++ b/spec/models/create_conference_webhook_spec.rb @@ -0,0 +1,866 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::CreateConferenceWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::CreateConferenceWebhook do + let(:instance) { Freeclimb::CreateConferenceWebhook.new } + + describe 'test an instance of CreateConferenceWebhook' do + it 'should create an instance of CreateConferenceWebhook' do + expect(instance).to be_instance_of(Freeclimb::CreateConferenceWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of CreateConferenceWebhook' do + payload = '{ "requestType": "createConference" }' + expect(Freeclimb::CreateConferenceWebhook.deserialize(payload)).to be_instance_of(Freeclimb::CreateConferenceWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "status"' do + it 'assigns value EMPTY' do + instance.status = Freeclimb::ConferenceStatus::EMPTY + expect(instance.status).to eq(Freeclimb::ConferenceStatus::EMPTY) + end + it 'assigns value POPULATED' do + instance.status = Freeclimb::ConferenceStatus::POPULATED + expect(instance.status).to eq(Freeclimb::ConferenceStatus::POPULATED) + end + it 'assigns value IN_PROGRESS' do + instance.status = Freeclimb::ConferenceStatus::IN_PROGRESS + expect(instance.status).to eq(Freeclimb::ConferenceStatus::IN_PROGRESS) + end + it 'assigns value TERMINATED' do + instance.status = Freeclimb::ConferenceStatus::TERMINATED + expect(instance.status).to eq(Freeclimb::ConferenceStatus::TERMINATED) + end + end + describe 'test attribute "recording_url"' do + it 'should work' do + instance.recording_url = "TEST_STRING" + expect(instance.recording_url).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_id"' do + it 'should work' do + instance.recording_id = "TEST_STRING" + expect(instance.recording_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_duration_sec"' do + it 'should work' do + + + instance.recording_duration_sec = 1 + expect(instance.recording_duration_sec).to eq(1) + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::CreateConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::CreateConferenceWebhook' do + expect { instance = Freeclimb::CreateConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::CreateConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::CreateConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::CreateConferenceWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::CreateConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + instance_2 = Freeclimb::CreateConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::CreateConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 2, + + ) + instance_2 = Freeclimb::CreateConferenceWebhook.new( + request_type: "ST", + + call_id: "ST", + + account_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + + status: nil, + + recording_url: "ST", + + recording_id: "ST", + + recording_duration_sec: 1, + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::CreateConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::CreateConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + instance_2 = Freeclimb::CreateConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::CreateConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_url' do + expect(instance._deserialize("String", instance.recording_url)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_id' do + expect(instance._deserialize("String", instance.recording_id)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_duration_sec' do + expect(instance._deserialize("Integer", instance.recording_duration_sec)).to be_a_kind_of(Integer) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::CreateConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::CreateConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::CreateConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + instance_2 = Freeclimb::CreateConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + status: Freeclimb::ConferenceStatus::EMPTY, + + recording_url: "TS", + + recording_id: "TS", + + recording_duration_sec: 1, + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::CreateConferenceWebhook.new( + request_type: "TS", + + + call_id: "TS", + + + account_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + + + status: Freeclimb::ConferenceStatus::EMPTY, + + + recording_url: "TS", + + + recording_id: "TS", + + + recording_duration_sec: 1, + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + it 'returns status in the form of hash' do + expect(instance._to_hash(instance.status)).to eq(instance.status) + end + it 'returns recording_url in the form of hash' do + expect(instance._to_hash(instance.recording_url)).to eq(instance.recording_url) + end + it 'returns recording_id in the form of hash' do + expect(instance._to_hash(instance.recording_id)).to eq(instance.recording_id) + end + it 'returns recording_duration_sec in the form of hash' do + expect(instance._to_hash(instance.recording_duration_sec)).to eq(instance.recording_duration_sec) + end + end + +end diff --git a/spec/models/create_web_rtc_token_spec.rb b/spec/models/create_web_rtc_token_spec.rb index 4fe2d810..3c384a26 100644 --- a/spec/models/create_web_rtc_token_spec.rb +++ b/spec/models/create_web_rtc_token_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -55,27 +55,36 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::CreateWebRTCToken.new( - to: "TS", - from: "TS", - uses: 1, - )}.not_to raise_error() + expect { instance = Freeclimb::CreateWebRTCToken.new( + to: "TS", + + from: "TS", + + uses: 1, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::CreateWebRTCToken' do - expect{instance = Freeclimb::CreateWebRTCToken.new( - to: "TS", - from: "TS", - uses: 1, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::CreateWebRTCToken.new( + to: "TS", + + from: "TS", + + uses: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::CreateWebRTCToken.new( - to: "TS", - from: "TS", - uses: 1, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::CreateWebRTCToken.new( + to: "TS", + + from: "TS", + + uses: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -83,8 +92,11 @@ it 'checks if properties are valid' do instance = Freeclimb::CreateWebRTCToken.new( to: "TS", + from: "TS", + uses: 1, + ) expect(instance.valid?).to eq(true) end @@ -104,13 +116,19 @@ obj = Object.new() instance_1 = Freeclimb::CreateWebRTCToken.new( to: "TS", + from: "TS", + uses: 1, + ) instance_2 = Freeclimb::CreateWebRTCToken.new( to: "TS", + from: "TS", + uses: 1, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -118,13 +136,19 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::CreateWebRTCToken.new( to: "TS", + from: "TS", + uses: 1 + 1, + ) instance_2 = Freeclimb::CreateWebRTCToken.new( to: "ST", + from: "ST", + uses: 1 + 2, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -134,10 +158,13 @@ it 'calculates hash code' do instance = Freeclimb::CreateWebRTCToken.new( to: "TS", + from: "TS", + uses: 1, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -145,10 +172,21 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::CreateWebRTCToken.new( to: "TS", + from: "TS", + uses: 1, + ) - instance_2 = Freeclimb::CreateWebRTCToken.new + instance_2 = Freeclimb::CreateWebRTCToken.new( + to: "TS", + + from: "TS", + + uses: 1, + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -156,8 +194,11 @@ describe 'test method "_deserialize"' do instance = Freeclimb::CreateWebRTCToken.new( to: "TS", + from: "TS", + uses: 1, + ) it 'deserializes the data of to' do expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) @@ -174,8 +215,11 @@ it 'returns the string representation of the object' do instance = Freeclimb::CreateWebRTCToken.new( to: "TS", + from: "TS", + uses: 1, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -185,8 +229,11 @@ it 'returns the object in the form of hash' do instance = Freeclimb::CreateWebRTCToken.new( to: "TS", + from: "TS", + uses: 1, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -194,13 +241,19 @@ obj = Object.new() instance_1 = Freeclimb::CreateWebRTCToken.new( to: "TS", + from: "TS", + uses: 1, + ) instance_2 = Freeclimb::CreateWebRTCToken.new( to: "TS", + from: "TS", + uses: 1, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -209,10 +262,13 @@ describe 'test method "_to_hash"' do instance = Freeclimb::CreateWebRTCToken.new( to: "TS", + from: "TS", + uses: 1, + ) it 'returns to in the form of hash' do expect(instance._to_hash(instance.to)).to eq(instance.to) diff --git a/spec/models/dequeue_spec.rb b/spec/models/dequeue_spec.rb index 551c67b2..46534540 100644 --- a/spec/models/dequeue_spec.rb +++ b/spec/models/dequeue_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/dequeue_webhook_spec.rb b/spec/models/dequeue_webhook_spec.rb new file mode 100644 index 00000000..5d677b3e --- /dev/null +++ b/spec/models/dequeue_webhook_spec.rb @@ -0,0 +1,743 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::DequeueWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::DequeueWebhook do + let(:instance) { Freeclimb::DequeueWebhook.new } + + describe 'test an instance of DequeueWebhook' do + it 'should create an instance of DequeueWebhook' do + expect(instance).to be_instance_of(Freeclimb::DequeueWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of DequeueWebhook' do + payload = '{ "requestType": "dequeue" }' + expect(Freeclimb::DequeueWebhook.deserialize(payload)).to be_instance_of(Freeclimb::DequeueWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_result"' do + it 'should work' do + instance.queue_result = "TEST_STRING" + expect(instance.queue_result).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_time"' do + it 'should work' do + + + instance.queue_time = 1 + expect(instance.queue_time).to eq(1) + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::DequeueWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_result: "TS", + + queue_time: 1, + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::DequeueWebhook' do + expect { instance = Freeclimb::DequeueWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_result: "TS", + + queue_time: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::DequeueWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_result: "TS", + + queue_time: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::DequeueWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_result: "TS", + + queue_time: 1, + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::DequeueWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::DequeueWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_result: "TS", + + queue_time: 1, + + ) + instance_2 = Freeclimb::DequeueWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_result: "TS", + + queue_time: 1, + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::DequeueWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_result: "TS", + + queue_time: 2, + + ) + instance_2 = Freeclimb::DequeueWebhook.new( + request_type: "ST", + + call_id: "ST", + + account_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + queue_result: "ST", + + queue_time: 1, + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::DequeueWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_result: "TS", + + queue_time: 1, + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::DequeueWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_result: "TS", + + queue_time: 1, + + ) + instance_2 = Freeclimb::DequeueWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_result: "TS", + + queue_time: 1, + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::DequeueWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_result: "TS", + + queue_time: 1, + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_result' do + expect(instance._deserialize("String", instance.queue_result)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_time' do + expect(instance._deserialize("Integer", instance.queue_time)).to be_a_kind_of(Integer) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::DequeueWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_result: "TS", + + queue_time: 1, + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::DequeueWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_result: "TS", + + queue_time: 1, + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::DequeueWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_result: "TS", + + queue_time: 1, + + ) + instance_2 = Freeclimb::DequeueWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_result: "TS", + + queue_time: 1, + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::DequeueWebhook.new( + request_type: "TS", + + + call_id: "TS", + + + account_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + + queue_result: "TS", + + + queue_time: 1, + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + it 'returns queue_result in the form of hash' do + expect(instance._to_hash(instance.queue_result)).to eq(instance.queue_result) + end + it 'returns queue_time in the form of hash' do + expect(instance._to_hash(instance.queue_time)).to eq(instance.queue_time) + end + end + +end diff --git a/spec/models/enqueue_spec.rb b/spec/models/enqueue_spec.rb index b7825a88..2d79f33f 100644 --- a/spec/models/enqueue_spec.rb +++ b/spec/models/enqueue_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -60,30 +60,42 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::Enqueue.new( - action_url: "TS", - notification_url: "TS", - queue_id: "TS", - wait_url: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::Enqueue.new( + action_url: "TS", + + notification_url: "TS", + + queue_id: "TS", + + wait_url: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::Enqueue' do - expect{instance = Freeclimb::Enqueue.new( - action_url: "TS", - notification_url: "TS", - queue_id: "TS", - wait_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Enqueue.new( + action_url: "TS", + + notification_url: "TS", + + queue_id: "TS", + + wait_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::Enqueue.new( - action_url: "TS", - notification_url: "TS", - queue_id: "TS", - wait_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Enqueue.new( + action_url: "TS", + + notification_url: "TS", + + queue_id: "TS", + + wait_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -91,9 +103,13 @@ it 'checks if properties are valid' do instance = Freeclimb::Enqueue.new( action_url: "TS", + notification_url: "TS", + queue_id: "TS", + wait_url: "TS", + ) expect(instance.valid?).to eq(true) end @@ -113,15 +129,23 @@ obj = Object.new() instance_1 = Freeclimb::Enqueue.new( action_url: "TS", + notification_url: "TS", + queue_id: "TS", + wait_url: "TS", + ) instance_2 = Freeclimb::Enqueue.new( action_url: "TS", + notification_url: "TS", + queue_id: "TS", + wait_url: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -129,15 +153,23 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::Enqueue.new( action_url: "TS", + notification_url: "TS", + queue_id: "TS", + wait_url: "TS", + ) instance_2 = Freeclimb::Enqueue.new( action_url: "ST", + notification_url: "ST", + queue_id: "ST", + wait_url: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -147,11 +179,15 @@ it 'calculates hash code' do instance = Freeclimb::Enqueue.new( action_url: "TS", + notification_url: "TS", + queue_id: "TS", + wait_url: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -159,11 +195,25 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::Enqueue.new( action_url: "TS", + + notification_url: "TS", + + queue_id: "TS", + + wait_url: "TS", + + ) + instance_2 = Freeclimb::Enqueue.new( + action_url: "TS", + notification_url: "TS", + queue_id: "TS", + wait_url: "TS", + ) - instance_2 = Freeclimb::Enqueue.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -171,9 +221,13 @@ describe 'test method "_deserialize"' do instance = Freeclimb::Enqueue.new( action_url: "TS", + notification_url: "TS", + queue_id: "TS", + wait_url: "TS", + ) it 'deserializes the data of action_url' do expect(instance._deserialize("String", instance.action_url)).to be_a_kind_of(String) @@ -193,9 +247,13 @@ it 'returns the string representation of the object' do instance = Freeclimb::Enqueue.new( action_url: "TS", + notification_url: "TS", + queue_id: "TS", + wait_url: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -205,9 +263,13 @@ it 'returns the object in the form of hash' do instance = Freeclimb::Enqueue.new( action_url: "TS", + notification_url: "TS", + queue_id: "TS", + wait_url: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -215,15 +277,23 @@ obj = Object.new() instance_1 = Freeclimb::Enqueue.new( action_url: "TS", + notification_url: "TS", + queue_id: "TS", + wait_url: "TS", + ) instance_2 = Freeclimb::Enqueue.new( action_url: "TS", + notification_url: "TS", + queue_id: "TS", + wait_url: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -232,12 +302,16 @@ describe 'test method "_to_hash"' do instance = Freeclimb::Enqueue.new( action_url: "TS", + notification_url: "TS", + queue_id: "TS", + wait_url: "TS", + ) it 'returns action_url in the form of hash' do expect(instance._to_hash(instance.action_url)).to eq(instance.action_url) diff --git a/spec/models/filter_logs_request_spec.rb b/spec/models/filter_logs_request_spec.rb index 4efa12a8..380b6857 100644 --- a/spec/models/filter_logs_request_spec.rb +++ b/spec/models/filter_logs_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -36,21 +36,24 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::FilterLogsRequest.new( - pql: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::FilterLogsRequest.new( + pql: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::FilterLogsRequest' do - expect{instance = Freeclimb::FilterLogsRequest.new( - pql: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::FilterLogsRequest.new( + pql: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::FilterLogsRequest.new( - pql: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::FilterLogsRequest.new( + pql: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -58,6 +61,7 @@ it 'checks if properties are valid' do instance = Freeclimb::FilterLogsRequest.new( pql: "TS", + ) expect(instance.valid?).to eq(true) end @@ -77,9 +81,11 @@ obj = Object.new() instance_1 = Freeclimb::FilterLogsRequest.new( pql: "TS", + ) instance_2 = Freeclimb::FilterLogsRequest.new( pql: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -87,9 +93,11 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::FilterLogsRequest.new( pql: "TS", + ) instance_2 = Freeclimb::FilterLogsRequest.new( pql: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -99,8 +107,9 @@ it 'calculates hash code' do instance = Freeclimb::FilterLogsRequest.new( pql: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -108,8 +117,13 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::FilterLogsRequest.new( pql: "TS", + ) - instance_2 = Freeclimb::FilterLogsRequest.new + instance_2 = Freeclimb::FilterLogsRequest.new( + pql: "TS", + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -117,6 +131,7 @@ describe 'test method "_deserialize"' do instance = Freeclimb::FilterLogsRequest.new( pql: "TS", + ) it 'deserializes the data of pql' do expect(instance._deserialize("String", instance.pql)).to be_a_kind_of(String) @@ -127,6 +142,7 @@ it 'returns the string representation of the object' do instance = Freeclimb::FilterLogsRequest.new( pql: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -136,6 +152,7 @@ it 'returns the object in the form of hash' do instance = Freeclimb::FilterLogsRequest.new( pql: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -143,9 +160,11 @@ obj = Object.new() instance_1 = Freeclimb::FilterLogsRequest.new( pql: "TS", + ) instance_2 = Freeclimb::FilterLogsRequest.new( pql: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -154,6 +173,7 @@ describe 'test method "_to_hash"' do instance = Freeclimb::FilterLogsRequest.new( pql: "TS", + ) it 'returns pql in the form of hash' do expect(instance._to_hash(instance.pql)).to eq(instance.pql) diff --git a/spec/models/get_digits_reason_spec.rb b/spec/models/get_digits_reason_spec.rb new file mode 100644 index 00000000..93777680 --- /dev/null +++ b/spec/models/get_digits_reason_spec.rb @@ -0,0 +1,93 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::GetDigitsReason +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::GetDigitsReason do + let(:instance) { Freeclimb::GetDigitsReason.new } + + describe 'test an instance of GetDigitsReason' do + it 'should create an instance of GetDigitsReason' do + expect(instance).to be_instance_of(Freeclimb::GetDigitsReason) + end + end + + describe 'test attribute "FINISH_KEY"' do + it 'should work' do + expect { Freeclimb::GetDigitsReason::FINISH_KEY = "finishKey" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::GetDigitsReason::FINISH_KEY + calculatedValue = Freeclimb::GetDigitsReason::build_from_hash("finishKey") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "finishKey" + calculatedValue = Freeclimb::GetDigitsReason::FINISH_KEY + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "TIMEOUT"' do + it 'should work' do + expect { Freeclimb::GetDigitsReason::TIMEOUT = "timeout" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::GetDigitsReason::TIMEOUT + calculatedValue = Freeclimb::GetDigitsReason::build_from_hash("timeout") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "timeout" + calculatedValue = Freeclimb::GetDigitsReason::TIMEOUT + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "MAX_DIGITS"' do + it 'should work' do + expect { Freeclimb::GetDigitsReason::MAX_DIGITS = "maxDigits" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::GetDigitsReason::MAX_DIGITS + calculatedValue = Freeclimb::GetDigitsReason::build_from_hash("maxDigits") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "maxDigits" + calculatedValue = Freeclimb::GetDigitsReason::MAX_DIGITS + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "TONE"' do + it 'should work' do + expect { Freeclimb::GetDigitsReason::TONE = "tone" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::GetDigitsReason::TONE + calculatedValue = Freeclimb::GetDigitsReason::build_from_hash("tone") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "tone" + calculatedValue = Freeclimb::GetDigitsReason::TONE + expect(expectedValue).to eq(calculatedValue) + end + end + +end diff --git a/spec/models/get_digits_spec.rb b/spec/models/get_digits_spec.rb index 8e1d85c4..7874ff68 100644 --- a/spec/models/get_digits_spec.rb +++ b/spec/models/get_digits_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -108,45 +108,72 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::GetDigits.new( - action_url: "TS", - digit_timeout_ms: 1, - finish_on_key: "TS", - flush_buffer: true, - initial_timeout_ms: 1, - max_digits: 1, - min_digits: 1, - prompts: Array.new(), - privacy_mode: true, - )}.not_to raise_error() + expect { instance = Freeclimb::GetDigits.new( + action_url: "TS", + + digit_timeout_ms: 1, + + finish_on_key: "TS", + + flush_buffer: true, + + initial_timeout_ms: 1, + + max_digits: 1, + + min_digits: 1, + + prompts: Array.new(), + + privacy_mode: true, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::GetDigits' do - expect{instance = Freeclimb::GetDigits.new( - action_url: "TS", - digit_timeout_ms: 1, - finish_on_key: "TS", - flush_buffer: true, - initial_timeout_ms: 1, - max_digits: 1, - min_digits: 1, - prompts: Array.new(), - privacy_mode: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::GetDigits.new( + action_url: "TS", + + digit_timeout_ms: 1, + + finish_on_key: "TS", + + flush_buffer: true, + + initial_timeout_ms: 1, + + max_digits: 1, + + min_digits: 1, + + prompts: Array.new(), + + privacy_mode: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::GetDigits.new( - action_url: "TS", - digit_timeout_ms: 1, - finish_on_key: "TS", - flush_buffer: true, - initial_timeout_ms: 1, - max_digits: 1, - min_digits: 1, - prompts: Array.new(), - privacy_mode: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::GetDigits.new( + action_url: "TS", + + digit_timeout_ms: 1, + + finish_on_key: "TS", + + flush_buffer: true, + + initial_timeout_ms: 1, + + max_digits: 1, + + min_digits: 1, + + prompts: Array.new(), + + privacy_mode: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -154,14 +181,23 @@ it 'checks if properties are valid' do instance = Freeclimb::GetDigits.new( action_url: "TS", + digit_timeout_ms: 1, + finish_on_key: "TS", + flush_buffer: true, + initial_timeout_ms: 1, + max_digits: 1, + min_digits: 1, + prompts: Array.new(), + privacy_mode: true, + ) expect(instance.valid?).to eq(true) end @@ -181,27 +217,43 @@ obj = Object.new() instance_1 = Freeclimb::GetDigits.new( action_url: "TS", + digit_timeout_ms: 1, + finish_on_key: "TS", + flush_buffer: true, + initial_timeout_ms: 1, + max_digits: 1, + min_digits: 1, - prompts: Freeclimb::PerclCommand.new(), + prompts: [], + privacy_mode: true, + ) instance_2 = Freeclimb::GetDigits.new( action_url: "TS", + digit_timeout_ms: 1, + finish_on_key: "TS", + flush_buffer: true, + initial_timeout_ms: 1, + max_digits: 1, + min_digits: 1, - prompts: Freeclimb::PerclCommand.new(), + prompts: [], + privacy_mode: true, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -209,27 +261,43 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::GetDigits.new( action_url: "TS", + digit_timeout_ms: 2, + finish_on_key: "TS", + flush_buffer: true, + initial_timeout_ms: 2, + max_digits: 2, + min_digits: 2, - prompts: Freeclimb::PerclCommand.new(), + prompts: [], + privacy_mode: true, + ) instance_2 = Freeclimb::GetDigits.new( action_url: "ST", + digit_timeout_ms: 1, + finish_on_key: "ST", + flush_buffer: false, + initial_timeout_ms: 1, + max_digits: 1, + min_digits: 1, - prompts: Freeclimb::PerclCommand.new(), + prompts: nil, + privacy_mode: false, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -239,16 +307,25 @@ it 'calculates hash code' do instance = Freeclimb::GetDigits.new( action_url: "TS", + digit_timeout_ms: 1, + finish_on_key: "TS", + flush_buffer: true, + initial_timeout_ms: 1, + max_digits: 1, + min_digits: 1, + prompts: Array.new(), + privacy_mode: true, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -256,16 +333,45 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::GetDigits.new( action_url: "TS", + + digit_timeout_ms: 1, + + finish_on_key: "TS", + + flush_buffer: true, + + initial_timeout_ms: 1, + + max_digits: 1, + + min_digits: 1, + + prompts: Array.new(), + + privacy_mode: true, + + ) + instance_2 = Freeclimb::GetDigits.new( + action_url: "TS", + digit_timeout_ms: 1, + finish_on_key: "TS", + flush_buffer: true, + initial_timeout_ms: 1, + max_digits: 1, + min_digits: 1, + prompts: Array.new(), + privacy_mode: true, + ) - instance_2 = Freeclimb::GetDigits.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -273,14 +379,23 @@ describe 'test method "_deserialize"' do instance = Freeclimb::GetDigits.new( action_url: "TS", + digit_timeout_ms: 1, + finish_on_key: "TS", + flush_buffer: true, + initial_timeout_ms: 1, + max_digits: 1, + min_digits: 1, + prompts: Array.new(), + privacy_mode: true, + ) it 'deserializes the data of action_url' do expect(instance._deserialize("String", instance.action_url)).to be_a_kind_of(String) @@ -315,14 +430,23 @@ it 'returns the string representation of the object' do instance = Freeclimb::GetDigits.new( action_url: "TS", + digit_timeout_ms: 1, + finish_on_key: "TS", + flush_buffer: true, + initial_timeout_ms: 1, + max_digits: 1, + min_digits: 1, + prompts: Array.new(), + privacy_mode: true, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -332,14 +456,23 @@ it 'returns the object in the form of hash' do instance = Freeclimb::GetDigits.new( action_url: "TS", + digit_timeout_ms: 1, + finish_on_key: "TS", + flush_buffer: true, + initial_timeout_ms: 1, + max_digits: 1, + min_digits: 1, + prompts: Array.new(), + privacy_mode: true, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -347,25 +480,43 @@ obj = Object.new() instance_1 = Freeclimb::GetDigits.new( action_url: "TS", + digit_timeout_ms: 1, + finish_on_key: "TS", + flush_buffer: true, + initial_timeout_ms: 1, + max_digits: 1, + min_digits: 1, + prompts: Array.new(), + privacy_mode: true, + ) instance_2 = Freeclimb::GetDigits.new( action_url: "TS", + digit_timeout_ms: 1, + finish_on_key: "TS", + flush_buffer: true, + initial_timeout_ms: 1, + max_digits: 1, + min_digits: 1, + prompts: Array.new(), + privacy_mode: true, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -374,22 +525,31 @@ describe 'test method "_to_hash"' do instance = Freeclimb::GetDigits.new( action_url: "TS", + digit_timeout_ms: 1, + finish_on_key: "TS", + flush_buffer: true, + initial_timeout_ms: 1, + max_digits: 1, + min_digits: 1, + prompts: Array.new(), + privacy_mode: true, + ) it 'returns action_url in the form of hash' do expect(instance._to_hash(instance.action_url)).to eq(instance.action_url) diff --git a/spec/models/get_digits_webhook_spec.rb b/spec/models/get_digits_webhook_spec.rb new file mode 100644 index 00000000..7cf9c8c6 --- /dev/null +++ b/spec/models/get_digits_webhook_spec.rb @@ -0,0 +1,815 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::GetDigitsWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::GetDigitsWebhook do + let(:instance) { Freeclimb::GetDigitsWebhook.new } + + describe 'test an instance of GetDigitsWebhook' do + it 'should create an instance of GetDigitsWebhook' do + expect(instance).to be_instance_of(Freeclimb::GetDigitsWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of GetDigitsWebhook' do + payload = '{ "requestType": "getDigits" }' + expect(Freeclimb::GetDigitsWebhook.deserialize(payload)).to be_instance_of(Freeclimb::GetDigitsWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "digits"' do + it 'should work' do + instance.digits = "TEST_STRING" + expect(instance.digits).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "reason"' do + it 'assigns value FINISH_KEY' do + instance.reason = Freeclimb::GetDigitsReason::FINISH_KEY + expect(instance.reason).to eq(Freeclimb::GetDigitsReason::FINISH_KEY) + end + it 'assigns value TIMEOUT' do + instance.reason = Freeclimb::GetDigitsReason::TIMEOUT + expect(instance.reason).to eq(Freeclimb::GetDigitsReason::TIMEOUT) + end + it 'assigns value MAX_DIGITS' do + instance.reason = Freeclimb::GetDigitsReason::MAX_DIGITS + expect(instance.reason).to eq(Freeclimb::GetDigitsReason::MAX_DIGITS) + end + it 'assigns value TONE' do + instance.reason = Freeclimb::GetDigitsReason::TONE + expect(instance.reason).to eq(Freeclimb::GetDigitsReason::TONE) + end + end + describe 'test attribute "parent_call_id"' do + it 'should work' do + instance.parent_call_id = "TEST_STRING" + expect(instance.parent_call_id).to eq("TEST_STRING") + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::GetDigitsWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + digits: "TS", + + + reason: Freeclimb::GetDigitsReason::FINISH_KEY, + + parent_call_id: "TS", + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::GetDigitsWebhook' do + expect { instance = Freeclimb::GetDigitsWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + digits: "TS", + + + reason: Freeclimb::GetDigitsReason::FINISH_KEY, + + parent_call_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::GetDigitsWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + digits: "TS", + + + reason: Freeclimb::GetDigitsReason::FINISH_KEY, + + parent_call_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::GetDigitsWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + digits: "TS", + + + reason: Freeclimb::GetDigitsReason::FINISH_KEY, + + parent_call_id: "TS", + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::GetDigitsWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::GetDigitsWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + digits: "TS", + + + reason: Freeclimb::GetDigitsReason::FINISH_KEY, + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::GetDigitsWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + digits: "TS", + + + reason: Freeclimb::GetDigitsReason::FINISH_KEY, + + parent_call_id: "TS", + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::GetDigitsWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + digits: "TS", + + + reason: Freeclimb::GetDigitsReason::FINISH_KEY, + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::GetDigitsWebhook.new( + request_type: "ST", + + call_id: "ST", + + account_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + digits: "ST", + + + reason: nil, + + parent_call_id: "ST", + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::GetDigitsWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + digits: "TS", + + + reason: Freeclimb::GetDigitsReason::FINISH_KEY, + + parent_call_id: "TS", + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::GetDigitsWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + digits: "TS", + + + reason: Freeclimb::GetDigitsReason::FINISH_KEY, + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::GetDigitsWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + digits: "TS", + + + reason: Freeclimb::GetDigitsReason::FINISH_KEY, + + parent_call_id: "TS", + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::GetDigitsWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + digits: "TS", + + + reason: Freeclimb::GetDigitsReason::FINISH_KEY, + + parent_call_id: "TS", + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + it 'deserializes the data of digits' do + expect(instance._deserialize("String", instance.digits)).to be_a_kind_of(String) + end + it 'deserializes the data of parent_call_id' do + expect(instance._deserialize("String", instance.parent_call_id)).to be_a_kind_of(String) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::GetDigitsWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + digits: "TS", + + + reason: Freeclimb::GetDigitsReason::FINISH_KEY, + + parent_call_id: "TS", + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::GetDigitsWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + digits: "TS", + + + reason: Freeclimb::GetDigitsReason::FINISH_KEY, + + parent_call_id: "TS", + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::GetDigitsWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + digits: "TS", + + + reason: Freeclimb::GetDigitsReason::FINISH_KEY, + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::GetDigitsWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + digits: "TS", + + + reason: Freeclimb::GetDigitsReason::FINISH_KEY, + + parent_call_id: "TS", + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::GetDigitsWebhook.new( + request_type: "TS", + + + call_id: "TS", + + + account_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + + digits: "TS", + + + + reason: Freeclimb::GetDigitsReason::FINISH_KEY, + + + parent_call_id: "TS", + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + it 'returns digits in the form of hash' do + expect(instance._to_hash(instance.digits)).to eq(instance.digits) + end + it 'returns reason in the form of hash' do + expect(instance._to_hash(instance.reason)).to eq(instance.reason) + end + it 'returns parent_call_id in the form of hash' do + expect(instance._to_hash(instance.parent_call_id)).to eq(instance.parent_call_id) + end + end + +end diff --git a/spec/models/get_speech_reason_spec.rb b/spec/models/get_speech_reason_spec.rb index c4f8fc99..0f8e1fd1 100644 --- a/spec/models/get_speech_reason_spec.rb +++ b/spec/models/get_speech_reason_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/get_speech_spec.rb b/spec/models/get_speech_spec.rb index 6f62cfa5..70e7e37d 100644 --- a/spec/models/get_speech_spec.rb +++ b/spec/models/get_speech_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -45,7 +45,6 @@ expect(instance.grammar_type).to eq(Freeclimb::GrammarType::BUILT_IN) end end - describe 'test attribute "grammar_file"' do it 'should work' do instance.grammar_file = "TEST_STRING" @@ -148,51 +147,93 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::GetSpeech.new( - action_url: "TS", - grammar_type: "URL", - grammar_file: "TS", - grammar_rule: "TS", - play_beep: true, - prompts: Array.new(), - no_input_timeout_ms: 1, - recognition_timeout_ms: 1, - speech_complete_timeout_ms: 1, - speech_incomplete_timeout_ms: 1, - privacy_mode: true, - )}.not_to raise_error() + expect { instance = Freeclimb::GetSpeech.new( + action_url: "TS", + + + grammar_type: Freeclimb::GrammarType::URL, + + grammar_file: "TS", + + grammar_rule: "TS", + + play_beep: true, + + prompts: Array.new(), + + no_input_timeout_ms: 1, + + recognition_timeout_ms: 1, + + + + speech_complete_timeout_ms: 1, + + speech_incomplete_timeout_ms: 1, + + privacy_mode: true, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::GetSpeech' do - expect{instance = Freeclimb::GetSpeech.new( - action_url: "TS", - grammar_type: "URL", - grammar_file: "TS", - grammar_rule: "TS", - play_beep: true, - prompts: Array.new(), - no_input_timeout_ms: 1, - recognition_timeout_ms: 1, - speech_complete_timeout_ms: 1, - speech_incomplete_timeout_ms: 1, - privacy_mode: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::GetSpeech.new( + action_url: "TS", + + + grammar_type: Freeclimb::GrammarType::URL, + + grammar_file: "TS", + + grammar_rule: "TS", + + play_beep: true, + + prompts: Array.new(), + + no_input_timeout_ms: 1, + + recognition_timeout_ms: 1, + + + + speech_complete_timeout_ms: 1, + + speech_incomplete_timeout_ms: 1, + + privacy_mode: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::GetSpeech.new( - action_url: "TS", - grammar_type: "URL", - grammar_file: "TS", - grammar_rule: "TS", - play_beep: true, - prompts: Array.new(), - no_input_timeout_ms: 1, - recognition_timeout_ms: 1, - speech_complete_timeout_ms: 1, - speech_incomplete_timeout_ms: 1, - privacy_mode: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::GetSpeech.new( + action_url: "TS", + + + grammar_type: Freeclimb::GrammarType::URL, + + grammar_file: "TS", + + grammar_rule: "TS", + + play_beep: true, + + prompts: Array.new(), + + no_input_timeout_ms: 1, + + recognition_timeout_ms: 1, + + + + speech_complete_timeout_ms: 1, + + speech_incomplete_timeout_ms: 1, + + privacy_mode: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -200,18 +241,32 @@ it 'checks if properties are valid' do instance = Freeclimb::GetSpeech.new( action_url: "TS", - grammar_type: "URL", + + + grammar_type: Freeclimb::GrammarType::URL, + grammar_file: "TS", + grammar_rule: "TS", + play_beep: true, + prompts: Array.new(), + no_input_timeout_ms: 1, + recognition_timeout_ms: 1, + confidence_threshold: 1, + sensitivity_level: 1, + speech_complete_timeout_ms: 1, + speech_incomplete_timeout_ms: 1, + privacy_mode: true, + ) expect(instance.valid?).to eq(true) end @@ -231,33 +286,57 @@ obj = Object.new() instance_1 = Freeclimb::GetSpeech.new( action_url: "TS", - grammar_type: Freeclimb::GrammarType.new(), - grammar_type: "URL", + + + grammar_type: Freeclimb::GrammarType::URL, + grammar_file: "TS", + grammar_rule: "TS", + play_beep: true, - prompts: Freeclimb::PerclCommand.new(), + prompts: [], + no_input_timeout_ms: 1, + recognition_timeout_ms: 1, + + + speech_complete_timeout_ms: 1, + speech_incomplete_timeout_ms: 1, + privacy_mode: true, + ) instance_2 = Freeclimb::GetSpeech.new( action_url: "TS", - grammar_type: Freeclimb::GrammarType.new(), - grammar_type: "URL", + + + grammar_type: Freeclimb::GrammarType::URL, + grammar_file: "TS", + grammar_rule: "TS", + play_beep: true, - prompts: Freeclimb::PerclCommand.new(), + prompts: [], + no_input_timeout_ms: 1, + recognition_timeout_ms: 1, + + + speech_complete_timeout_ms: 1, + speech_incomplete_timeout_ms: 1, + privacy_mode: true, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -265,33 +344,57 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::GetSpeech.new( action_url: "TS", - grammar_type: Freeclimb::GrammarType.new(), - grammar_type: "URL", + + + grammar_type: Freeclimb::GrammarType::URL, + grammar_file: "TS", + grammar_rule: "TS", + play_beep: true, - prompts: Freeclimb::PerclCommand.new(), + prompts: [], + no_input_timeout_ms: 2, + recognition_timeout_ms: 2, + + + speech_complete_timeout_ms: 2, + speech_incomplete_timeout_ms: 2, + privacy_mode: true, + ) instance_2 = Freeclimb::GetSpeech.new( action_url: "ST", - grammar_type: Freeclimb::GrammarType.new(), - grammar_type: "BUILT_IN", + + + grammar_type: nil, + grammar_file: "ST", + grammar_rule: "ST", + play_beep: false, - prompts: Freeclimb::PerclCommand.new(), + prompts: nil, + no_input_timeout_ms: 1, + recognition_timeout_ms: 1, + + + speech_complete_timeout_ms: 1, + speech_incomplete_timeout_ms: 1, + privacy_mode: false, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -301,18 +404,32 @@ it 'calculates hash code' do instance = Freeclimb::GetSpeech.new( action_url: "TS", - grammar_type: "URL", + + + grammar_type: Freeclimb::GrammarType::URL, + grammar_file: "TS", + grammar_rule: "TS", + play_beep: true, + prompts: Array.new(), + no_input_timeout_ms: 1, + recognition_timeout_ms: 1, + + + speech_complete_timeout_ms: 1, + speech_incomplete_timeout_ms: 1, + privacy_mode: true, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -320,18 +437,59 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::GetSpeech.new( action_url: "TS", - grammar_type: "URL", + + + grammar_type: Freeclimb::GrammarType::URL, + + grammar_file: "TS", + + grammar_rule: "TS", + + play_beep: true, + + prompts: Array.new(), + + no_input_timeout_ms: 1, + + recognition_timeout_ms: 1, + + + + speech_complete_timeout_ms: 1, + + speech_incomplete_timeout_ms: 1, + + privacy_mode: true, + + ) + instance_2 = Freeclimb::GetSpeech.new( + action_url: "TS", + + + grammar_type: Freeclimb::GrammarType::URL, + grammar_file: "TS", + grammar_rule: "TS", + play_beep: true, + prompts: Array.new(), + no_input_timeout_ms: 1, + recognition_timeout_ms: 1, + + + speech_complete_timeout_ms: 1, + speech_incomplete_timeout_ms: 1, + privacy_mode: true, + ) - instance_2 = Freeclimb::GetSpeech.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -339,16 +497,30 @@ describe 'test method "_deserialize"' do instance = Freeclimb::GetSpeech.new( action_url: "TS", - grammar_type: "URL", + + + grammar_type: Freeclimb::GrammarType::URL, + grammar_file: "TS", + grammar_rule: "TS", + play_beep: true, + prompts: Array.new(), + no_input_timeout_ms: 1, + recognition_timeout_ms: 1, + + + speech_complete_timeout_ms: 1, + speech_incomplete_timeout_ms: 1, + privacy_mode: true, + ) it 'deserializes the data of action_url' do expect(instance._deserialize("String", instance.action_url)).to be_a_kind_of(String) @@ -392,16 +564,30 @@ it 'returns the string representation of the object' do instance = Freeclimb::GetSpeech.new( action_url: "TS", - grammar_type: "URL", + + + grammar_type: Freeclimb::GrammarType::URL, + grammar_file: "TS", + grammar_rule: "TS", + play_beep: true, + prompts: Array.new(), + no_input_timeout_ms: 1, + recognition_timeout_ms: 1, + + + speech_complete_timeout_ms: 1, + speech_incomplete_timeout_ms: 1, + privacy_mode: true, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -411,16 +597,30 @@ it 'returns the object in the form of hash' do instance = Freeclimb::GetSpeech.new( action_url: "TS", - grammar_type: "URL", + + + grammar_type: Freeclimb::GrammarType::URL, + grammar_file: "TS", + grammar_rule: "TS", + play_beep: true, + prompts: Array.new(), + no_input_timeout_ms: 1, + recognition_timeout_ms: 1, + + + speech_complete_timeout_ms: 1, + speech_incomplete_timeout_ms: 1, + privacy_mode: true, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -428,29 +628,57 @@ obj = Object.new() instance_1 = Freeclimb::GetSpeech.new( action_url: "TS", - grammar_type: "URL", + + + grammar_type: Freeclimb::GrammarType::URL, + grammar_file: "TS", + grammar_rule: "TS", + play_beep: true, + prompts: Array.new(), + no_input_timeout_ms: 1, + recognition_timeout_ms: 1, + + + speech_complete_timeout_ms: 1, + speech_incomplete_timeout_ms: 1, + privacy_mode: true, + ) instance_2 = Freeclimb::GetSpeech.new( action_url: "TS", - grammar_type: "URL", + + + grammar_type: Freeclimb::GrammarType::URL, + grammar_file: "TS", + grammar_rule: "TS", + play_beep: true, + prompts: Array.new(), + no_input_timeout_ms: 1, + recognition_timeout_ms: 1, + + + speech_complete_timeout_ms: 1, + speech_incomplete_timeout_ms: 1, + privacy_mode: true, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -459,28 +687,42 @@ describe 'test method "_to_hash"' do instance = Freeclimb::GetSpeech.new( action_url: "TS", + - grammar_type: "URL", + + grammar_type: Freeclimb::GrammarType::URL, + grammar_file: "TS", + grammar_rule: "TS", + play_beep: true, + prompts: Array.new(), + no_input_timeout_ms: 1, + recognition_timeout_ms: 1, + + + speech_complete_timeout_ms: 1, + speech_incomplete_timeout_ms: 1, + privacy_mode: true, + ) it 'returns action_url in the form of hash' do expect(instance._to_hash(instance.action_url)).to eq(instance.action_url) diff --git a/spec/models/get_speech_webhook_spec.rb b/spec/models/get_speech_webhook_spec.rb new file mode 100644 index 00000000..a2729893 --- /dev/null +++ b/spec/models/get_speech_webhook_spec.rb @@ -0,0 +1,1072 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::GetSpeechWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::GetSpeechWebhook do + let(:instance) { Freeclimb::GetSpeechWebhook.new } + + describe 'test an instance of GetSpeechWebhook' do + it 'should create an instance of GetSpeechWebhook' do + expect(instance).to be_instance_of(Freeclimb::GetSpeechWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of GetSpeechWebhook' do + payload = '{ "requestType": "getSpeech" }' + expect(Freeclimb::GetSpeechWebhook.deserialize(payload)).to be_instance_of(Freeclimb::GetSpeechWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "reason"' do + it 'assigns value ERROR' do + instance.reason = Freeclimb::GetSpeechReason::ERROR + expect(instance.reason).to eq(Freeclimb::GetSpeechReason::ERROR) + end + it 'assigns value HANGUP' do + instance.reason = Freeclimb::GetSpeechReason::HANGUP + expect(instance.reason).to eq(Freeclimb::GetSpeechReason::HANGUP) + end + it 'assigns value DIGIT' do + instance.reason = Freeclimb::GetSpeechReason::DIGIT + expect(instance.reason).to eq(Freeclimb::GetSpeechReason::DIGIT) + end + it 'assigns value NO_INPUT' do + instance.reason = Freeclimb::GetSpeechReason::NO_INPUT + expect(instance.reason).to eq(Freeclimb::GetSpeechReason::NO_INPUT) + end + it 'assigns value NO_MATCH' do + instance.reason = Freeclimb::GetSpeechReason::NO_MATCH + expect(instance.reason).to eq(Freeclimb::GetSpeechReason::NO_MATCH) + end + it 'assigns value RECOGNITION' do + instance.reason = Freeclimb::GetSpeechReason::RECOGNITION + expect(instance.reason).to eq(Freeclimb::GetSpeechReason::RECOGNITION) + end + end + describe 'test attribute "recognition_result"' do + it 'should work' do + instance.recognition_result = "TEST_STRING" + expect(instance.recognition_result).to eq("TEST_STRING") + + end + end + + describe 'test attribute "confidence"' do + it 'should work' do + + + instance.confidence = 1 + expect(instance.confidence).to eq(1) + + end + end + + describe 'test attribute "parent_call_id"' do + it 'should work' do + instance.parent_call_id = "TEST_STRING" + expect(instance.parent_call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "completion_reason"' do + it 'should work' do + instance.completion_reason = "TEST_STRING" + expect(instance.completion_reason).to eq("TEST_STRING") + + end + end + + describe 'test attribute "completion_cause"' do + it 'should work' do + instance.completion_cause = "TEST_STRING" + expect(instance.completion_cause).to eq("TEST_STRING") + + end + end + + describe 'test attribute "mrcp_code"' do + it 'should work' do + + + instance.mrcp_code = 1 + expect(instance.mrcp_code).to eq(1) + + end + end + + describe 'test attribute "mrcp_diagnostic"' do + it 'should work' do + instance.mrcp_diagnostic = "TEST_STRING" + expect(instance.mrcp_diagnostic).to eq("TEST_STRING") + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::GetSpeechWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + reason: Freeclimb::GetSpeechReason::ERROR, + + recognition_result: "TS", + + confidence: 1, + + parent_call_id: "TS", + + completion_reason: "TS", + + completion_cause: "TS", + + mrcp_code: 1, + + mrcp_diagnostic: "TS", + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::GetSpeechWebhook' do + expect { instance = Freeclimb::GetSpeechWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + reason: Freeclimb::GetSpeechReason::ERROR, + + recognition_result: "TS", + + confidence: 1, + + parent_call_id: "TS", + + completion_reason: "TS", + + completion_cause: "TS", + + mrcp_code: 1, + + mrcp_diagnostic: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::GetSpeechWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + reason: Freeclimb::GetSpeechReason::ERROR, + + recognition_result: "TS", + + confidence: 1, + + parent_call_id: "TS", + + completion_reason: "TS", + + completion_cause: "TS", + + mrcp_code: 1, + + mrcp_diagnostic: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::GetSpeechWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + reason: Freeclimb::GetSpeechReason::ERROR, + + recognition_result: "TS", + + confidence: 1, + + parent_call_id: "TS", + + completion_reason: "TS", + + completion_cause: "TS", + + mrcp_code: 1, + + mrcp_diagnostic: "TS", + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::GetSpeechWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::GetSpeechWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + reason: Freeclimb::GetSpeechReason::ERROR, + + recognition_result: "TS", + + confidence: 1, + + parent_call_id: "TS", + + completion_reason: "TS", + + completion_cause: "TS", + + mrcp_code: 1, + + mrcp_diagnostic: "TS", + + ) + instance_2 = Freeclimb::GetSpeechWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + reason: Freeclimb::GetSpeechReason::ERROR, + + recognition_result: "TS", + + confidence: 1, + + parent_call_id: "TS", + + completion_reason: "TS", + + completion_cause: "TS", + + mrcp_code: 1, + + mrcp_diagnostic: "TS", + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::GetSpeechWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + reason: Freeclimb::GetSpeechReason::ERROR, + + recognition_result: "TS", + + confidence: 2, + + parent_call_id: "TS", + + completion_reason: "TS", + + completion_cause: "TS", + + mrcp_code: 2, + + mrcp_diagnostic: "TS", + + ) + instance_2 = Freeclimb::GetSpeechWebhook.new( + request_type: "ST", + + call_id: "ST", + + account_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + + reason: nil, + + recognition_result: "ST", + + confidence: 1, + + parent_call_id: "ST", + + completion_reason: "ST", + + completion_cause: "ST", + + mrcp_code: 1, + + mrcp_diagnostic: "ST", + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::GetSpeechWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + reason: Freeclimb::GetSpeechReason::ERROR, + + recognition_result: "TS", + + confidence: 1, + + parent_call_id: "TS", + + completion_reason: "TS", + + completion_cause: "TS", + + mrcp_code: 1, + + mrcp_diagnostic: "TS", + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::GetSpeechWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + reason: Freeclimb::GetSpeechReason::ERROR, + + recognition_result: "TS", + + confidence: 1, + + parent_call_id: "TS", + + completion_reason: "TS", + + completion_cause: "TS", + + mrcp_code: 1, + + mrcp_diagnostic: "TS", + + ) + instance_2 = Freeclimb::GetSpeechWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + reason: Freeclimb::GetSpeechReason::ERROR, + + recognition_result: "TS", + + confidence: 1, + + parent_call_id: "TS", + + completion_reason: "TS", + + completion_cause: "TS", + + mrcp_code: 1, + + mrcp_diagnostic: "TS", + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::GetSpeechWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + reason: Freeclimb::GetSpeechReason::ERROR, + + recognition_result: "TS", + + confidence: 1, + + parent_call_id: "TS", + + completion_reason: "TS", + + completion_cause: "TS", + + mrcp_code: 1, + + mrcp_diagnostic: "TS", + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + it 'deserializes the data of recognition_result' do + expect(instance._deserialize("String", instance.recognition_result)).to be_a_kind_of(String) + end + it 'deserializes the data of confidence' do + expect(instance._deserialize("Integer", instance.confidence)).to be_a_kind_of(Integer) + end + it 'deserializes the data of parent_call_id' do + expect(instance._deserialize("String", instance.parent_call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of completion_reason' do + expect(instance._deserialize("String", instance.completion_reason)).to be_a_kind_of(String) + end + it 'deserializes the data of completion_cause' do + expect(instance._deserialize("String", instance.completion_cause)).to be_a_kind_of(String) + end + it 'deserializes the data of mrcp_code' do + expect(instance._deserialize("Integer", instance.mrcp_code)).to be_a_kind_of(Integer) + end + it 'deserializes the data of mrcp_diagnostic' do + expect(instance._deserialize("String", instance.mrcp_diagnostic)).to be_a_kind_of(String) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::GetSpeechWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + reason: Freeclimb::GetSpeechReason::ERROR, + + recognition_result: "TS", + + confidence: 1, + + parent_call_id: "TS", + + completion_reason: "TS", + + completion_cause: "TS", + + mrcp_code: 1, + + mrcp_diagnostic: "TS", + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::GetSpeechWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + reason: Freeclimb::GetSpeechReason::ERROR, + + recognition_result: "TS", + + confidence: 1, + + parent_call_id: "TS", + + completion_reason: "TS", + + completion_cause: "TS", + + mrcp_code: 1, + + mrcp_diagnostic: "TS", + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::GetSpeechWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + reason: Freeclimb::GetSpeechReason::ERROR, + + recognition_result: "TS", + + confidence: 1, + + parent_call_id: "TS", + + completion_reason: "TS", + + completion_cause: "TS", + + mrcp_code: 1, + + mrcp_diagnostic: "TS", + + ) + instance_2 = Freeclimb::GetSpeechWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + reason: Freeclimb::GetSpeechReason::ERROR, + + recognition_result: "TS", + + confidence: 1, + + parent_call_id: "TS", + + completion_reason: "TS", + + completion_cause: "TS", + + mrcp_code: 1, + + mrcp_diagnostic: "TS", + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::GetSpeechWebhook.new( + request_type: "TS", + + + call_id: "TS", + + + account_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + + + reason: Freeclimb::GetSpeechReason::ERROR, + + + recognition_result: "TS", + + + confidence: 1, + + + parent_call_id: "TS", + + + completion_reason: "TS", + + + completion_cause: "TS", + + + mrcp_code: 1, + + + mrcp_diagnostic: "TS", + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + it 'returns reason in the form of hash' do + expect(instance._to_hash(instance.reason)).to eq(instance.reason) + end + it 'returns recognition_result in the form of hash' do + expect(instance._to_hash(instance.recognition_result)).to eq(instance.recognition_result) + end + it 'returns confidence in the form of hash' do + expect(instance._to_hash(instance.confidence)).to eq(instance.confidence) + end + it 'returns parent_call_id in the form of hash' do + expect(instance._to_hash(instance.parent_call_id)).to eq(instance.parent_call_id) + end + it 'returns completion_reason in the form of hash' do + expect(instance._to_hash(instance.completion_reason)).to eq(instance.completion_reason) + end + it 'returns completion_cause in the form of hash' do + expect(instance._to_hash(instance.completion_cause)).to eq(instance.completion_cause) + end + it 'returns mrcp_code in the form of hash' do + expect(instance._to_hash(instance.mrcp_code)).to eq(instance.mrcp_code) + end + it 'returns mrcp_diagnostic in the form of hash' do + expect(instance._to_hash(instance.mrcp_diagnostic)).to eq(instance.mrcp_diagnostic) + end + end + +end diff --git a/spec/models/grammar_file_built_in_spec.rb b/spec/models/grammar_file_built_in_spec.rb index c26ca5bd..0cabec37 100644 --- a/spec/models/grammar_file_built_in_spec.rb +++ b/spec/models/grammar_file_built_in_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/grammar_type_spec.rb b/spec/models/grammar_type_spec.rb index b810c3c2..804071b7 100644 --- a/spec/models/grammar_type_spec.rb +++ b/spec/models/grammar_type_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/hangup_spec.rb b/spec/models/hangup_spec.rb index 2610ac13..d351f817 100644 --- a/spec/models/hangup_spec.rb +++ b/spec/models/hangup_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -36,21 +36,24 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::Hangup.new( - reason: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::Hangup.new( + reason: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::Hangup' do - expect{instance = Freeclimb::Hangup.new( - reason: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Hangup.new( + reason: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::Hangup.new( - reason: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Hangup.new( + reason: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -58,6 +61,7 @@ it 'checks if properties are valid' do instance = Freeclimb::Hangup.new( reason: "TS", + ) expect(instance.valid?).to eq(true) end @@ -77,9 +81,11 @@ obj = Object.new() instance_1 = Freeclimb::Hangup.new( reason: "TS", + ) instance_2 = Freeclimb::Hangup.new( reason: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -87,9 +93,11 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::Hangup.new( reason: "TS", + ) instance_2 = Freeclimb::Hangup.new( reason: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -99,8 +107,9 @@ it 'calculates hash code' do instance = Freeclimb::Hangup.new( reason: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -108,8 +117,13 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::Hangup.new( reason: "TS", + ) - instance_2 = Freeclimb::Hangup.new + instance_2 = Freeclimb::Hangup.new( + reason: "TS", + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -117,6 +131,7 @@ describe 'test method "_deserialize"' do instance = Freeclimb::Hangup.new( reason: "TS", + ) it 'deserializes the data of reason' do expect(instance._deserialize("String", instance.reason)).to be_a_kind_of(String) @@ -127,6 +142,7 @@ it 'returns the string representation of the object' do instance = Freeclimb::Hangup.new( reason: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -136,6 +152,7 @@ it 'returns the object in the form of hash' do instance = Freeclimb::Hangup.new( reason: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -143,9 +160,11 @@ obj = Object.new() instance_1 = Freeclimb::Hangup.new( reason: "TS", + ) instance_2 = Freeclimb::Hangup.new( reason: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -154,6 +173,7 @@ describe 'test method "_to_hash"' do instance = Freeclimb::Hangup.new( reason: "TS", + ) it 'returns reason in the form of hash' do expect(instance._to_hash(instance.reason)).to eq(instance.reason) diff --git a/spec/models/if_machine_spec.rb b/spec/models/if_machine_spec.rb index b82c1702..1a533e4d 100644 --- a/spec/models/if_machine_spec.rb +++ b/spec/models/if_machine_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/inbound_call_webhook_spec.rb b/spec/models/inbound_call_webhook_spec.rb new file mode 100644 index 00000000..ac72a5b8 --- /dev/null +++ b/spec/models/inbound_call_webhook_spec.rb @@ -0,0 +1,692 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::InboundCallWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::InboundCallWebhook do + let(:instance) { Freeclimb::InboundCallWebhook.new } + + describe 'test an instance of InboundCallWebhook' do + it 'should create an instance of InboundCallWebhook' do + expect(instance).to be_instance_of(Freeclimb::InboundCallWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of InboundCallWebhook' do + payload = '{ "requestType": "inboundCall" }' + expect(Freeclimb::InboundCallWebhook.deserialize(payload)).to be_instance_of(Freeclimb::InboundCallWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "parent_call_id"' do + it 'should work' do + instance.parent_call_id = "TEST_STRING" + expect(instance.parent_call_id).to eq("TEST_STRING") + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::InboundCallWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::InboundCallWebhook' do + expect { instance = Freeclimb::InboundCallWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::InboundCallWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::InboundCallWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::InboundCallWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::InboundCallWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::InboundCallWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::InboundCallWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::InboundCallWebhook.new( + request_type: "ST", + + call_id: "ST", + + account_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + parent_call_id: "ST", + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::InboundCallWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::InboundCallWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::InboundCallWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::InboundCallWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + it 'deserializes the data of parent_call_id' do + expect(instance._deserialize("String", instance.parent_call_id)).to be_a_kind_of(String) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::InboundCallWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::InboundCallWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::InboundCallWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::InboundCallWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::InboundCallWebhook.new( + request_type: "TS", + + + call_id: "TS", + + + account_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + + parent_call_id: "TS", + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + it 'returns parent_call_id in the form of hash' do + expect(instance._to_hash(instance.parent_call_id)).to eq(instance.parent_call_id) + end + end + +end diff --git a/spec/models/incoming_number_list_spec.rb b/spec/models/incoming_number_list_spec.rb index f3eb7316..0b1283fe 100644 --- a/spec/models/incoming_number_list_spec.rb +++ b/spec/models/incoming_number_list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,42 +104,66 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::IncomingNumberList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - incoming_phone_numbers: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::IncomingNumberList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + incoming_phone_numbers: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::IncomingNumberList' do - expect{instance = Freeclimb::IncomingNumberList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - incoming_phone_numbers: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::IncomingNumberList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + incoming_phone_numbers: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::IncomingNumberList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - incoming_phone_numbers: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::IncomingNumberList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + incoming_phone_numbers: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -147,13 +171,21 @@ it 'checks if properties are valid' do instance = Freeclimb::IncomingNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + incoming_phone_numbers: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -173,25 +205,39 @@ obj = Object.new() instance_1 = Freeclimb::IncomingNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - incoming_phone_numbers: Freeclimb::IncomingNumberResult.new(), + incoming_phone_numbers: [], + ) instance_2 = Freeclimb::IncomingNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - incoming_phone_numbers: Freeclimb::IncomingNumberResult.new(), + incoming_phone_numbers: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,25 +245,39 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::IncomingNumberList.new( total: 2, + start: 2, + _end: 2, + page: 2, + num_pages: 2, + page_size: 2, + next_page_uri: "TS", - incoming_phone_numbers: Freeclimb::IncomingNumberResult.new(), + incoming_phone_numbers: [], + ) instance_2 = Freeclimb::IncomingNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "ST", - incoming_phone_numbers: Freeclimb::IncomingNumberResult.new(), + incoming_phone_numbers: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -227,15 +287,23 @@ it 'calculates hash code' do instance = Freeclimb::IncomingNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + incoming_phone_numbers: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -243,15 +311,41 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::IncomingNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + incoming_phone_numbers: Array.new(), + ) - instance_2 = Freeclimb::IncomingNumberList.new + instance_2 = Freeclimb::IncomingNumberList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + incoming_phone_numbers: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -259,13 +353,21 @@ describe 'test method "_deserialize"' do instance = Freeclimb::IncomingNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + incoming_phone_numbers: Array.new(), + ) it 'deserializes the data of total' do expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) @@ -297,13 +399,21 @@ it 'returns the string representation of the object' do instance = Freeclimb::IncomingNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + incoming_phone_numbers: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -313,13 +423,21 @@ it 'returns the object in the form of hash' do instance = Freeclimb::IncomingNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + incoming_phone_numbers: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -327,23 +445,39 @@ obj = Object.new() instance_1 = Freeclimb::IncomingNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + incoming_phone_numbers: Array.new(), + ) instance_2 = Freeclimb::IncomingNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + incoming_phone_numbers: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -352,20 +486,28 @@ describe 'test method "_to_hash"' do instance = Freeclimb::IncomingNumberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + incoming_phone_numbers: Array.new(), + ) it 'returns total in the form of hash' do expect(instance._to_hash(instance.total)).to eq(instance.total) diff --git a/spec/models/incoming_number_request_spec.rb b/spec/models/incoming_number_request_spec.rb index de24ce2f..470fa2eb 100644 --- a/spec/models/incoming_number_request_spec.rb +++ b/spec/models/incoming_number_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -52,27 +52,36 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::IncomingNumberRequest.new( - application_id: "TS", - _alias: "TS", - campaign_id: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::IncomingNumberRequest.new( + application_id: "TS", + + _alias: "TS", + + campaign_id: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::IncomingNumberRequest' do - expect{instance = Freeclimb::IncomingNumberRequest.new( - application_id: "TS", - _alias: "TS", - campaign_id: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::IncomingNumberRequest.new( + application_id: "TS", + + _alias: "TS", + + campaign_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::IncomingNumberRequest.new( - application_id: "TS", - _alias: "TS", - campaign_id: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::IncomingNumberRequest.new( + application_id: "TS", + + _alias: "TS", + + campaign_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -80,8 +89,11 @@ it 'checks if properties are valid' do instance = Freeclimb::IncomingNumberRequest.new( application_id: "TS", + _alias: "TS", + campaign_id: "TS", + ) expect(instance.valid?).to eq(true) end @@ -101,13 +113,19 @@ obj = Object.new() instance_1 = Freeclimb::IncomingNumberRequest.new( application_id: "TS", + _alias: "TS", + campaign_id: "TS", + ) instance_2 = Freeclimb::IncomingNumberRequest.new( application_id: "TS", + _alias: "TS", + campaign_id: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -115,13 +133,19 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::IncomingNumberRequest.new( application_id: "TS", + _alias: "TS", + campaign_id: "TS", + ) instance_2 = Freeclimb::IncomingNumberRequest.new( application_id: "ST", + _alias: "ST", + campaign_id: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -131,10 +155,13 @@ it 'calculates hash code' do instance = Freeclimb::IncomingNumberRequest.new( application_id: "TS", + _alias: "TS", + campaign_id: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -142,10 +169,21 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::IncomingNumberRequest.new( application_id: "TS", + _alias: "TS", + campaign_id: "TS", + ) - instance_2 = Freeclimb::IncomingNumberRequest.new + instance_2 = Freeclimb::IncomingNumberRequest.new( + application_id: "TS", + + _alias: "TS", + + campaign_id: "TS", + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -153,8 +191,11 @@ describe 'test method "_deserialize"' do instance = Freeclimb::IncomingNumberRequest.new( application_id: "TS", + _alias: "TS", + campaign_id: "TS", + ) it 'deserializes the data of application_id' do expect(instance._deserialize("String", instance.application_id)).to be_a_kind_of(String) @@ -171,8 +212,11 @@ it 'returns the string representation of the object' do instance = Freeclimb::IncomingNumberRequest.new( application_id: "TS", + _alias: "TS", + campaign_id: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -182,8 +226,11 @@ it 'returns the object in the form of hash' do instance = Freeclimb::IncomingNumberRequest.new( application_id: "TS", + _alias: "TS", + campaign_id: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -191,13 +238,19 @@ obj = Object.new() instance_1 = Freeclimb::IncomingNumberRequest.new( application_id: "TS", + _alias: "TS", + campaign_id: "TS", + ) instance_2 = Freeclimb::IncomingNumberRequest.new( application_id: "TS", + _alias: "TS", + campaign_id: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -206,10 +259,13 @@ describe 'test method "_to_hash"' do instance = Freeclimb::IncomingNumberRequest.new( application_id: "TS", + _alias: "TS", + campaign_id: "TS", + ) it 'returns application_id in the form of hash' do expect(instance._to_hash(instance.application_id)).to eq(instance.application_id) diff --git a/spec/models/incoming_number_result_spec.rb b/spec/models/incoming_number_result_spec.rb index abb836d7..a246a908 100644 --- a/spec/models/incoming_number_result_spec.rb +++ b/spec/models/incoming_number_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -166,69 +166,120 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::IncomingNumberResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - capabilities: Freeclimb::Capabilities.new(), - campaign_id: "TS", - phone_number_id: "TS", - account_id: "TS", - application_id: "TS", - phone_number: "TS", - _alias: "TS", - region: "TS", - country: "TS", - voice_enabled: true, - sms_enabled: true, - offnet: true, - tfn: Freeclimb::TFN.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::IncomingNumberResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + + capabilities: Freeclimb::Capabilities.new(), + campaign_id: "TS", + + phone_number_id: "TS", + + account_id: "TS", + + application_id: "TS", + + phone_number: "TS", + + _alias: "TS", + + region: "TS", + + country: "TS", + + voice_enabled: true, + + sms_enabled: true, + + offnet: true, + + + tfn: Freeclimb::TFN.new(), + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::IncomingNumberResult' do - expect{instance = Freeclimb::IncomingNumberResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - capabilities: Freeclimb::Capabilities.new, - campaign_id: "TS", - phone_number_id: "TS", - account_id: "TS", - application_id: "TS", - phone_number: "TS", - _alias: "TS", - region: "TS", - country: "TS", - voice_enabled: true, - sms_enabled: true, - offnet: true, - tfn: Freeclimb::TFN.new, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::IncomingNumberResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + + capabilities: Freeclimb::Capabilities.new, + campaign_id: "TS", + + phone_number_id: "TS", + + account_id: "TS", + + application_id: "TS", + + phone_number: "TS", + + _alias: "TS", + + region: "TS", + + country: "TS", + + voice_enabled: true, + + sms_enabled: true, + + offnet: true, + + + tfn: Freeclimb::TFN.new, + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::IncomingNumberResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - capabilities: Freeclimb::Capabilities.new, - campaign_id: "TS", - phone_number_id: "TS", - account_id: "TS", - application_id: "TS", - phone_number: "TS", - _alias: "TS", - region: "TS", - country: "TS", - voice_enabled: true, - sms_enabled: true, - offnet: true, - tfn: Freeclimb::TFN.new, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::IncomingNumberResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + + capabilities: Freeclimb::Capabilities.new, + campaign_id: "TS", + + phone_number_id: "TS", + + account_id: "TS", + + application_id: "TS", + + phone_number: "TS", + + _alias: "TS", + + region: "TS", + + country: "TS", + + voice_enabled: true, + + sms_enabled: true, + + offnet: true, + + + tfn: Freeclimb::TFN.new, + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -236,21 +287,38 @@ it 'checks if properties are valid' do instance = Freeclimb::IncomingNumberResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + + capabilities: Freeclimb::Capabilities.new(), campaign_id: "TS", + phone_number_id: "TS", + account_id: "TS", + application_id: "TS", + phone_number: "TS", + _alias: "TS", + region: "TS", + country: "TS", + voice_enabled: true, + sms_enabled: true, + offnet: true, + + tfn: Freeclimb::TFN.new(), ) expect(instance.valid?).to eq(true) @@ -271,41 +339,75 @@ obj = Object.new() instance_1 = Freeclimb::IncomingNumberResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + capabilities: Freeclimb::Capabilities.new(), + campaign_id: "TS", + phone_number_id: "TS", + account_id: "TS", + application_id: "TS", + phone_number: "TS", + _alias: "TS", + region: "TS", + country: "TS", + voice_enabled: true, + sms_enabled: true, + offnet: true, + tfn: Freeclimb::TFN.new(), + ) instance_2 = Freeclimb::IncomingNumberResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + capabilities: Freeclimb::Capabilities.new(), + campaign_id: "TS", + phone_number_id: "TS", + account_id: "TS", + application_id: "TS", + phone_number: "TS", + _alias: "TS", + region: "TS", + country: "TS", + voice_enabled: true, + sms_enabled: true, + offnet: true, + tfn: Freeclimb::TFN.new(), + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -313,41 +415,75 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::IncomingNumberResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 2, + capabilities: Freeclimb::Capabilities.new(), + campaign_id: "TS", + phone_number_id: "TS", + account_id: "TS", + application_id: "TS", + phone_number: "TS", + _alias: "TS", + region: "TS", + country: "TS", + voice_enabled: true, + sms_enabled: true, + offnet: true, + tfn: Freeclimb::TFN.new(), + ) instance_2 = Freeclimb::IncomingNumberResult.new( uri: "ST", + date_created: "ST", + date_updated: "ST", + revision: 1, + capabilities: Freeclimb::Capabilities.new(), + campaign_id: "ST", + phone_number_id: "ST", + account_id: "ST", + application_id: "ST", + phone_number: "ST", + _alias: "ST", + region: "ST", + country: "ST", + voice_enabled: false, + sms_enabled: false, + offnet: false, + tfn: Freeclimb::TFN.new(), + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -357,24 +493,41 @@ it 'calculates hash code' do instance = Freeclimb::IncomingNumberResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + + capabilities: Freeclimb::Capabilities.new(), campaign_id: "TS", + phone_number_id: "TS", + account_id: "TS", + application_id: "TS", + phone_number: "TS", + _alias: "TS", + region: "TS", + country: "TS", + voice_enabled: true, + sms_enabled: true, + offnet: true, + + tfn: Freeclimb::TFN.new(), ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -382,24 +535,77 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::IncomingNumberResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + + capabilities: Freeclimb::Capabilities.new(), campaign_id: "TS", + phone_number_id: "TS", + account_id: "TS", + application_id: "TS", + phone_number: "TS", + _alias: "TS", + region: "TS", + country: "TS", + voice_enabled: true, + sms_enabled: true, + offnet: true, + + tfn: Freeclimb::TFN.new(), ) - instance_2 = Freeclimb::IncomingNumberResult.new + instance_2 = Freeclimb::IncomingNumberResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + + capabilities: Freeclimb::Capabilities.new(), + campaign_id: "TS", + + phone_number_id: "TS", + + account_id: "TS", + + application_id: "TS", + + phone_number: "TS", + + _alias: "TS", + + region: "TS", + + country: "TS", + + voice_enabled: true, + + sms_enabled: true, + + offnet: true, + + + tfn: Freeclimb::TFN.new(), + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -407,21 +613,38 @@ describe 'test method "_deserialize"' do instance = Freeclimb::IncomingNumberResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + + capabilities: Freeclimb::Capabilities.new, campaign_id: "TS", + phone_number_id: "TS", + account_id: "TS", + application_id: "TS", + phone_number: "TS", + _alias: "TS", + region: "TS", + country: "TS", + voice_enabled: true, + sms_enabled: true, + offnet: true, + + tfn: Freeclimb::TFN.new, ) it 'deserializes the data of uri' do @@ -481,21 +704,38 @@ it 'returns the string representation of the object' do instance = Freeclimb::IncomingNumberResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + + capabilities: Freeclimb::Capabilities.new, campaign_id: "TS", + phone_number_id: "TS", + account_id: "TS", + application_id: "TS", + phone_number: "TS", + _alias: "TS", + region: "TS", + country: "TS", + voice_enabled: true, + sms_enabled: true, + offnet: true, + + tfn: Freeclimb::TFN.new, ) expect(instance.to_s).to eq(instance.to_hash.to_s) @@ -506,21 +746,38 @@ it 'returns the object in the form of hash' do instance = Freeclimb::IncomingNumberResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + + capabilities: Freeclimb::Capabilities.new, campaign_id: "TS", + phone_number_id: "TS", + account_id: "TS", + application_id: "TS", + phone_number: "TS", + _alias: "TS", + region: "TS", + country: "TS", + voice_enabled: true, + sms_enabled: true, + offnet: true, + + tfn: Freeclimb::TFN.new, ) expect(instance.to_hash).to be_a_kind_of(Hash) @@ -529,40 +786,74 @@ obj = Object.new() instance_1 = Freeclimb::IncomingNumberResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + + capabilities: Freeclimb::Capabilities.new, campaign_id: "TS", + phone_number_id: "TS", + account_id: "TS", + application_id: "TS", + phone_number: "TS", + _alias: "TS", + region: "TS", + country: "TS", + voice_enabled: true, + sms_enabled: true, + offnet: true, + + tfn: Freeclimb::TFN.new, ) instance_2 = Freeclimb::IncomingNumberResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + + capabilities: Freeclimb::Capabilities.new, campaign_id: "TS", + phone_number_id: "TS", + account_id: "TS", + application_id: "TS", + phone_number: "TS", + _alias: "TS", + region: "TS", + country: "TS", + voice_enabled: true, + sms_enabled: true, + offnet: true, + + tfn: Freeclimb::TFN.new, ) expect(instance_1.to_hash).to eq(instance_2.to_hash) @@ -572,36 +863,53 @@ describe 'test method "_to_hash"' do instance = Freeclimb::IncomingNumberResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + + campaign_id: "TS", + phone_number_id: "TS", + account_id: "TS", + application_id: "TS", + phone_number: "TS", + _alias: "TS", + region: "TS", + country: "TS", + voice_enabled: true, + sms_enabled: true, + offnet: true, + + ) it 'returns uri in the form of hash' do expect(instance._to_hash(instance.uri)).to eq(instance.uri) diff --git a/spec/models/language_spec.rb b/spec/models/language_spec.rb index 83f37a44..a9a25fd1 100644 --- a/spec/models/language_spec.rb +++ b/spec/models/language_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/leave_conference_webhook_spec.rb b/spec/models/leave_conference_webhook_spec.rb new file mode 100644 index 00000000..0c59cc40 --- /dev/null +++ b/spec/models/leave_conference_webhook_spec.rb @@ -0,0 +1,643 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::LeaveConferenceWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::LeaveConferenceWebhook do + let(:instance) { Freeclimb::LeaveConferenceWebhook.new } + + describe 'test an instance of LeaveConferenceWebhook' do + it 'should create an instance of LeaveConferenceWebhook' do + expect(instance).to be_instance_of(Freeclimb::LeaveConferenceWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of LeaveConferenceWebhook' do + payload = '{ "requestType": "leaveConference" }' + expect(Freeclimb::LeaveConferenceWebhook.deserialize(payload)).to be_instance_of(Freeclimb::LeaveConferenceWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::LeaveConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::LeaveConferenceWebhook' do + expect { instance = Freeclimb::LeaveConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::LeaveConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::LeaveConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::LeaveConferenceWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::LeaveConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + instance_2 = Freeclimb::LeaveConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::LeaveConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + instance_2 = Freeclimb::LeaveConferenceWebhook.new( + request_type: "ST", + + call_id: "ST", + + account_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::LeaveConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::LeaveConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + instance_2 = Freeclimb::LeaveConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::LeaveConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::LeaveConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::LeaveConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::LeaveConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + instance_2 = Freeclimb::LeaveConferenceWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::LeaveConferenceWebhook.new( + request_type: "TS", + + + call_id: "TS", + + + account_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + end + +end diff --git a/spec/models/log_level_spec.rb b/spec/models/log_level_spec.rb index 46efa4c2..7faa8051 100644 --- a/spec/models/log_level_spec.rb +++ b/spec/models/log_level_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/log_list_spec.rb b/spec/models/log_list_spec.rb index 4c91c62e..cda63294 100644 --- a/spec/models/log_list_spec.rb +++ b/spec/models/log_list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,42 +104,66 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::LogList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - logs: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::LogList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + logs: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::LogList' do - expect{instance = Freeclimb::LogList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - logs: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::LogList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + logs: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::LogList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - logs: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::LogList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + logs: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -147,13 +171,21 @@ it 'checks if properties are valid' do instance = Freeclimb::LogList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + logs: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -173,25 +205,39 @@ obj = Object.new() instance_1 = Freeclimb::LogList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - logs: Freeclimb::LogResult.new(), + logs: [], + ) instance_2 = Freeclimb::LogList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - logs: Freeclimb::LogResult.new(), + logs: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,25 +245,39 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::LogList.new( total: 2, + start: 2, + _end: 2, + page: 2, + num_pages: 2, + page_size: 2, + next_page_uri: "TS", - logs: Freeclimb::LogResult.new(), + logs: [], + ) instance_2 = Freeclimb::LogList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "ST", - logs: Freeclimb::LogResult.new(), + logs: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -227,15 +287,23 @@ it 'calculates hash code' do instance = Freeclimb::LogList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + logs: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -243,15 +311,41 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::LogList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + logs: Array.new(), + ) - instance_2 = Freeclimb::LogList.new + instance_2 = Freeclimb::LogList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + logs: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -259,13 +353,21 @@ describe 'test method "_deserialize"' do instance = Freeclimb::LogList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + logs: Array.new(), + ) it 'deserializes the data of total' do expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) @@ -297,13 +399,21 @@ it 'returns the string representation of the object' do instance = Freeclimb::LogList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + logs: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -313,13 +423,21 @@ it 'returns the object in the form of hash' do instance = Freeclimb::LogList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + logs: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -327,23 +445,39 @@ obj = Object.new() instance_1 = Freeclimb::LogList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + logs: Array.new(), + ) instance_2 = Freeclimb::LogList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + logs: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -352,20 +486,28 @@ describe 'test method "_to_hash"' do instance = Freeclimb::LogList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + logs: Array.new(), + ) it 'returns total in the form of hash' do expect(instance._to_hash(instance.total)).to eq(instance.total) diff --git a/spec/models/log_result_spec.rb b/spec/models/log_result_spec.rb index a2cba5d2..8f7bb724 100644 --- a/spec/models/log_result_spec.rb +++ b/spec/models/log_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -51,7 +51,6 @@ expect(instance.level).to eq(Freeclimb::LogLevel::ERROR) end end - describe 'test attribute "request_id"' do it 'should work' do instance.request_id = "TEST_STRING" @@ -95,39 +94,63 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::LogResult.new( - timestamp: 1, - level: "INFO", - request_id: "TS", - account_id: "TS", - call_id: "TS", - message: "TS", - metadata: Object.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::LogResult.new( + timestamp: 1, + + + level: Freeclimb::LogLevel::INFO, + + request_id: "TS", + + account_id: "TS", + + call_id: "TS", + + message: "TS", + + metadata: Object.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::LogResult' do - expect{instance = Freeclimb::LogResult.new( - timestamp: 1, - level: "INFO", - request_id: "TS", - account_id: "TS", - call_id: "TS", - message: "TS", - metadata: Object.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::LogResult.new( + timestamp: 1, + + + level: Freeclimb::LogLevel::INFO, + + request_id: "TS", + + account_id: "TS", + + call_id: "TS", + + message: "TS", + + metadata: Object.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::LogResult.new( - timestamp: 1, - level: "INFO", - request_id: "TS", - account_id: "TS", - call_id: "TS", - message: "TS", - metadata: Object.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::LogResult.new( + timestamp: 1, + + + level: Freeclimb::LogLevel::INFO, + + request_id: "TS", + + account_id: "TS", + + call_id: "TS", + + message: "TS", + + metadata: Object.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -135,12 +158,20 @@ it 'checks if properties are valid' do instance = Freeclimb::LogResult.new( timestamp: 1, - level: "INFO", + + + level: Freeclimb::LogLevel::INFO, + request_id: "TS", + account_id: "TS", + call_id: "TS", + message: "TS", + metadata: Object.new(), + ) expect(instance.valid?).to eq(true) end @@ -160,23 +191,37 @@ obj = Object.new() instance_1 = Freeclimb::LogResult.new( timestamp: 1, - level: Freeclimb::LogLevel.new(), - level: "INFO", + + + level: Freeclimb::LogLevel::INFO, + request_id: "TS", + account_id: "TS", + call_id: "TS", + message: "TS", + metadata: obj, + ) instance_2 = Freeclimb::LogResult.new( timestamp: 1, - level: Freeclimb::LogLevel.new(), - level: "INFO", + + + level: Freeclimb::LogLevel::INFO, + request_id: "TS", + account_id: "TS", + call_id: "TS", + message: "TS", + metadata: obj, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -184,23 +229,37 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::LogResult.new( timestamp: 2, - level: Freeclimb::LogLevel.new(), - level: "INFO", + + + level: Freeclimb::LogLevel::INFO, + request_id: "TS", + account_id: "TS", + call_id: "TS", + message: "TS", + metadata: Object.new(), + ) instance_2 = Freeclimb::LogResult.new( timestamp: 1, - level: Freeclimb::LogLevel.new(), - level: "WARNING", + + + level: nil, + request_id: "ST", + account_id: "ST", + call_id: "ST", + message: "ST", + metadata: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -210,14 +269,22 @@ it 'calculates hash code' do instance = Freeclimb::LogResult.new( timestamp: 1, - level: "INFO", + + + level: Freeclimb::LogLevel::INFO, + request_id: "TS", + account_id: "TS", + call_id: "TS", + message: "TS", + metadata: Object.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -225,14 +292,39 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::LogResult.new( timestamp: 1, - level: "INFO", + + + level: Freeclimb::LogLevel::INFO, + + request_id: "TS", + + account_id: "TS", + + call_id: "TS", + + message: "TS", + + metadata: Object.new(), + + ) + instance_2 = Freeclimb::LogResult.new( + timestamp: 1, + + + level: Freeclimb::LogLevel::INFO, + request_id: "TS", + account_id: "TS", + call_id: "TS", + message: "TS", + metadata: Object.new(), + ) - instance_2 = Freeclimb::LogResult.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -240,12 +332,20 @@ describe 'test method "_deserialize"' do instance = Freeclimb::LogResult.new( timestamp: 1, - level: "INFO", + + + level: Freeclimb::LogLevel::INFO, + request_id: "TS", + account_id: "TS", + call_id: "TS", + message: "TS", + metadata: Object.new(), + ) it 'deserializes the data of timestamp' do expect(instance._deserialize("Integer", instance.timestamp)).to be_a_kind_of(Integer) @@ -271,12 +371,20 @@ it 'returns the string representation of the object' do instance = Freeclimb::LogResult.new( timestamp: 1, - level: "INFO", + + + level: Freeclimb::LogLevel::INFO, + request_id: "TS", + account_id: "TS", + call_id: "TS", + message: "TS", + metadata: Object.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -286,12 +394,20 @@ it 'returns the object in the form of hash' do instance = Freeclimb::LogResult.new( timestamp: 1, - level: "INFO", + + + level: Freeclimb::LogLevel::INFO, + request_id: "TS", + account_id: "TS", + call_id: "TS", + message: "TS", + metadata: Object.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -299,21 +415,37 @@ obj = Object.new() instance_1 = Freeclimb::LogResult.new( timestamp: 1, - level: "INFO", + + + level: Freeclimb::LogLevel::INFO, + request_id: "TS", + account_id: "TS", + call_id: "TS", + message: "TS", + metadata: obj, + ) instance_2 = Freeclimb::LogResult.new( timestamp: 1, - level: "INFO", + + + level: Freeclimb::LogLevel::INFO, + request_id: "TS", + account_id: "TS", + call_id: "TS", + message: "TS", + metadata: obj, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -322,18 +454,26 @@ describe 'test method "_to_hash"' do instance = Freeclimb::LogResult.new( timestamp: 1, + - level: "INFO", + + level: Freeclimb::LogLevel::INFO, + request_id: "TS", + account_id: "TS", + call_id: "TS", + message: "TS", + metadata: Object.new(), + ) it 'returns timestamp in the form of hash' do expect(instance._to_hash(instance.timestamp)).to eq(instance.timestamp) diff --git a/spec/models/machine_detected_webhook_spec.rb b/spec/models/machine_detected_webhook_spec.rb new file mode 100644 index 00000000..791fb090 --- /dev/null +++ b/spec/models/machine_detected_webhook_spec.rb @@ -0,0 +1,758 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::MachineDetectedWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::MachineDetectedWebhook do + let(:instance) { Freeclimb::MachineDetectedWebhook.new } + + describe 'test an instance of MachineDetectedWebhook' do + it 'should create an instance of MachineDetectedWebhook' do + expect(instance).to be_instance_of(Freeclimb::MachineDetectedWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of MachineDetectedWebhook' do + payload = '{ "requestType": "machineDetected" }' + expect(Freeclimb::MachineDetectedWebhook.deserialize(payload)).to be_instance_of(Freeclimb::MachineDetectedWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "parent_call_id"' do + it 'should work' do + instance.parent_call_id = "TEST_STRING" + expect(instance.parent_call_id).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "machine_type"' do + it 'assigns value ANSWERING_MACHINE' do + instance.machine_type = Freeclimb::MachineType::ANSWERING_MACHINE + expect(instance.machine_type).to eq(Freeclimb::MachineType::ANSWERING_MACHINE) + end + it 'assigns value FAX_MODEM' do + instance.machine_type = Freeclimb::MachineType::FAX_MODEM + expect(instance.machine_type).to eq(Freeclimb::MachineType::FAX_MODEM) + end + end + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::MachineDetectedWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + + machine_type: Freeclimb::MachineType::ANSWERING_MACHINE, + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::MachineDetectedWebhook' do + expect { instance = Freeclimb::MachineDetectedWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + + machine_type: Freeclimb::MachineType::ANSWERING_MACHINE, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::MachineDetectedWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + + machine_type: Freeclimb::MachineType::ANSWERING_MACHINE, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::MachineDetectedWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + + machine_type: Freeclimb::MachineType::ANSWERING_MACHINE, + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::MachineDetectedWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::MachineDetectedWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + + machine_type: Freeclimb::MachineType::ANSWERING_MACHINE, + + ) + instance_2 = Freeclimb::MachineDetectedWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + + machine_type: Freeclimb::MachineType::ANSWERING_MACHINE, + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::MachineDetectedWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + + machine_type: Freeclimb::MachineType::ANSWERING_MACHINE, + + ) + instance_2 = Freeclimb::MachineDetectedWebhook.new( + request_type: "ST", + + call_id: "ST", + + account_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + parent_call_id: "ST", + + + machine_type: nil, + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::MachineDetectedWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + + machine_type: Freeclimb::MachineType::ANSWERING_MACHINE, + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::MachineDetectedWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + + machine_type: Freeclimb::MachineType::ANSWERING_MACHINE, + + ) + instance_2 = Freeclimb::MachineDetectedWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + + machine_type: Freeclimb::MachineType::ANSWERING_MACHINE, + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::MachineDetectedWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + + machine_type: Freeclimb::MachineType::ANSWERING_MACHINE, + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + it 'deserializes the data of parent_call_id' do + expect(instance._deserialize("String", instance.parent_call_id)).to be_a_kind_of(String) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::MachineDetectedWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + + machine_type: Freeclimb::MachineType::ANSWERING_MACHINE, + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::MachineDetectedWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + + machine_type: Freeclimb::MachineType::ANSWERING_MACHINE, + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::MachineDetectedWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + + machine_type: Freeclimb::MachineType::ANSWERING_MACHINE, + + ) + instance_2 = Freeclimb::MachineDetectedWebhook.new( + request_type: "TS", + + call_id: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + + machine_type: Freeclimb::MachineType::ANSWERING_MACHINE, + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::MachineDetectedWebhook.new( + request_type: "TS", + + + call_id: "TS", + + + account_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + + parent_call_id: "TS", + + + + machine_type: Freeclimb::MachineType::ANSWERING_MACHINE, + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + it 'returns parent_call_id in the form of hash' do + expect(instance._to_hash(instance.parent_call_id)).to eq(instance.parent_call_id) + end + it 'returns machine_type in the form of hash' do + expect(instance._to_hash(instance.machine_type)).to eq(instance.machine_type) + end + end + +end diff --git a/spec/models/machine_type_spec.rb b/spec/models/machine_type_spec.rb index 7d2eedc6..33df550e 100644 --- a/spec/models/machine_type_spec.rb +++ b/spec/models/machine_type_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -28,32 +28,32 @@ describe 'test attribute "ANSWERING_MACHINE"' do it 'should work' do - expect { Freeclimb::MachineType::ANSWERING_MACHINE = "answeringMachine" }.not_to raise_error + expect { Freeclimb::MachineType::ANSWERING_MACHINE = "answering machine" }.not_to raise_error end it 'should serialize to enum' do expectedValue = Freeclimb::MachineType::ANSWERING_MACHINE - calculatedValue = Freeclimb::MachineType::build_from_hash("answeringMachine") + calculatedValue = Freeclimb::MachineType::build_from_hash("answering machine") expect(expectedValue).to eq(calculatedValue) end it 'should deserialize to string' do - expectedValue = "answeringMachine" + expectedValue = "answering machine" calculatedValue = Freeclimb::MachineType::ANSWERING_MACHINE expect(expectedValue).to eq(calculatedValue) end end - describe 'test attribute "FAX_MACHINE"' do + describe 'test attribute "FAX_MODEM"' do it 'should work' do - expect { Freeclimb::MachineType::FAX_MACHINE = "faxMachine" }.not_to raise_error + expect { Freeclimb::MachineType::FAX_MODEM = "fax modem" }.not_to raise_error end it 'should serialize to enum' do - expectedValue = Freeclimb::MachineType::FAX_MACHINE - calculatedValue = Freeclimb::MachineType::build_from_hash("faxMachine") + expectedValue = Freeclimb::MachineType::FAX_MODEM + calculatedValue = Freeclimb::MachineType::build_from_hash("fax modem") expect(expectedValue).to eq(calculatedValue) end it 'should deserialize to string' do - expectedValue = "faxMachine" - calculatedValue = Freeclimb::MachineType::FAX_MACHINE + expectedValue = "fax modem" + calculatedValue = Freeclimb::MachineType::FAX_MODEM expect(expectedValue).to eq(calculatedValue) end end diff --git a/spec/models/make_call_request_spec.rb b/spec/models/make_call_request_spec.rb index 7c73a437..d6518f4c 100644 --- a/spec/models/make_call_request_spec.rb +++ b/spec/models/make_call_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -110,48 +110,78 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::MakeCallRequest.new( - from: "TS", - to: "TS", - application_id: "TS", - send_digits: "TS", - if_machine: "TS", - if_machine_url: "TS", - timeout: 1, - parent_call_id: "TS", - privacy_mode: true, - call_connect_url: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::MakeCallRequest.new( + from: "TS", + + to: "TS", + + application_id: "TS", + + send_digits: "TS", + + if_machine: "TS", + + if_machine_url: "TS", + + timeout: 1, + + parent_call_id: "TS", + + privacy_mode: true, + + call_connect_url: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::MakeCallRequest' do - expect{instance = Freeclimb::MakeCallRequest.new( - from: "TS", - to: "TS", - application_id: "TS", - send_digits: "TS", - if_machine: "TS", - if_machine_url: "TS", - timeout: 1, - parent_call_id: "TS", - privacy_mode: true, - call_connect_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::MakeCallRequest.new( + from: "TS", + + to: "TS", + + application_id: "TS", + + send_digits: "TS", + + if_machine: "TS", + + if_machine_url: "TS", + + timeout: 1, + + parent_call_id: "TS", + + privacy_mode: true, + + call_connect_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::MakeCallRequest.new( - from: "TS", - to: "TS", - application_id: "TS", - send_digits: "TS", - if_machine: "TS", - if_machine_url: "TS", - timeout: 1, - parent_call_id: "TS", - privacy_mode: true, - call_connect_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::MakeCallRequest.new( + from: "TS", + + to: "TS", + + application_id: "TS", + + send_digits: "TS", + + if_machine: "TS", + + if_machine_url: "TS", + + timeout: 1, + + parent_call_id: "TS", + + privacy_mode: true, + + call_connect_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -159,15 +189,25 @@ it 'checks if properties are valid' do instance = Freeclimb::MakeCallRequest.new( from: "TS", + to: "TS", + application_id: "TS", + send_digits: "TS", + if_machine: "TS", + if_machine_url: "TS", + timeout: 1, + parent_call_id: "TS", + privacy_mode: true, + call_connect_url: "TS", + ) expect(instance.valid?).to eq(true) end @@ -187,27 +227,47 @@ obj = Object.new() instance_1 = Freeclimb::MakeCallRequest.new( from: "TS", + to: "TS", + application_id: "TS", + send_digits: "TS", + if_machine: "TS", + if_machine_url: "TS", + timeout: 1, + parent_call_id: "TS", + privacy_mode: true, + call_connect_url: "TS", + ) instance_2 = Freeclimb::MakeCallRequest.new( from: "TS", + to: "TS", + application_id: "TS", + send_digits: "TS", + if_machine: "TS", + if_machine_url: "TS", + timeout: 1, + parent_call_id: "TS", + privacy_mode: true, + call_connect_url: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -215,27 +275,47 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::MakeCallRequest.new( from: "TS", + to: "TS", + application_id: "TS", + send_digits: "TS", + if_machine: "TS", + if_machine_url: "TS", + timeout: 2, + parent_call_id: "TS", + privacy_mode: true, + call_connect_url: "TS", + ) instance_2 = Freeclimb::MakeCallRequest.new( from: "ST", + to: "ST", + application_id: "ST", + send_digits: "ST", + if_machine: "ST", + if_machine_url: "ST", + timeout: 1, + parent_call_id: "ST", + privacy_mode: false, + call_connect_url: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -245,17 +325,27 @@ it 'calculates hash code' do instance = Freeclimb::MakeCallRequest.new( from: "TS", + to: "TS", + application_id: "TS", + send_digits: "TS", + if_machine: "TS", + if_machine_url: "TS", + timeout: 1, + parent_call_id: "TS", + privacy_mode: true, + call_connect_url: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -263,17 +353,49 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::MakeCallRequest.new( from: "TS", + + to: "TS", + + application_id: "TS", + + send_digits: "TS", + + if_machine: "TS", + + if_machine_url: "TS", + + timeout: 1, + + parent_call_id: "TS", + + privacy_mode: true, + + call_connect_url: "TS", + + ) + instance_2 = Freeclimb::MakeCallRequest.new( + from: "TS", + to: "TS", + application_id: "TS", + send_digits: "TS", + if_machine: "TS", + if_machine_url: "TS", + timeout: 1, + parent_call_id: "TS", + privacy_mode: true, + call_connect_url: "TS", + ) - instance_2 = Freeclimb::MakeCallRequest.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -281,15 +403,25 @@ describe 'test method "_deserialize"' do instance = Freeclimb::MakeCallRequest.new( from: "TS", + to: "TS", + application_id: "TS", + send_digits: "TS", + if_machine: "TS", + if_machine_url: "TS", + timeout: 1, + parent_call_id: "TS", + privacy_mode: true, + call_connect_url: "TS", + ) it 'deserializes the data of from' do expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) @@ -327,15 +459,25 @@ it 'returns the string representation of the object' do instance = Freeclimb::MakeCallRequest.new( from: "TS", + to: "TS", + application_id: "TS", + send_digits: "TS", + if_machine: "TS", + if_machine_url: "TS", + timeout: 1, + parent_call_id: "TS", + privacy_mode: true, + call_connect_url: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -345,15 +487,25 @@ it 'returns the object in the form of hash' do instance = Freeclimb::MakeCallRequest.new( from: "TS", + to: "TS", + application_id: "TS", + send_digits: "TS", + if_machine: "TS", + if_machine_url: "TS", + timeout: 1, + parent_call_id: "TS", + privacy_mode: true, + call_connect_url: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -361,27 +513,47 @@ obj = Object.new() instance_1 = Freeclimb::MakeCallRequest.new( from: "TS", + to: "TS", + application_id: "TS", + send_digits: "TS", + if_machine: "TS", + if_machine_url: "TS", + timeout: 1, + parent_call_id: "TS", + privacy_mode: true, + call_connect_url: "TS", + ) instance_2 = Freeclimb::MakeCallRequest.new( from: "TS", + to: "TS", + application_id: "TS", + send_digits: "TS", + if_machine: "TS", + if_machine_url: "TS", + timeout: 1, + parent_call_id: "TS", + privacy_mode: true, + call_connect_url: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -390,24 +562,34 @@ describe 'test method "_to_hash"' do instance = Freeclimb::MakeCallRequest.new( from: "TS", + to: "TS", + application_id: "TS", + send_digits: "TS", + if_machine: "TS", + if_machine_url: "TS", + timeout: 1, + parent_call_id: "TS", + privacy_mode: true, + call_connect_url: "TS", + ) it 'returns from in the form of hash' do expect(instance._to_hash(instance.from)).to eq(instance.from) diff --git a/spec/models/message_delivery_webhook_spec.rb b/spec/models/message_delivery_webhook_spec.rb new file mode 100644 index 00000000..c295be23 --- /dev/null +++ b/spec/models/message_delivery_webhook_spec.rb @@ -0,0 +1,630 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::MessageDeliveryWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::MessageDeliveryWebhook do + let(:instance) { Freeclimb::MessageDeliveryWebhook.new } + + describe 'test an instance of MessageDeliveryWebhook' do + it 'should create an instance of MessageDeliveryWebhook' do + expect(instance).to be_instance_of(Freeclimb::MessageDeliveryWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of MessageDeliveryWebhook' do + payload = '{ "requestType": "messageDelivery" }' + expect(Freeclimb::MessageDeliveryWebhook.deserialize(payload)).to be_instance_of(Freeclimb::MessageDeliveryWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + describe 'test attribute "text"' do + it 'should work' do + instance.text = "TEST_STRING" + expect(instance.text).to eq("TEST_STRING") + + end + end + + describe 'test attribute "direction"' do + it 'should work' do + instance.direction = "TEST_STRING" + expect(instance.direction).to eq("TEST_STRING") + + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + instance.application_id = "TEST_STRING" + expect(instance.application_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "status"' do + it 'should work' do + instance.status = "TEST_STRING" + expect(instance.status).to eq("TEST_STRING") + + end + end + + describe 'test attribute "phone_number_id"' do + it 'should work' do + instance.phone_number_id = "TEST_STRING" + expect(instance.phone_number_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "uri"' do + it 'should work' do + instance.uri = "TEST_STRING" + expect(instance.uri).to eq("TEST_STRING") + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::MessageDeliveryWebhook.new( + request_type: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + status: "TS", + + phone_number_id: "TS", + + uri: "TS", + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::MessageDeliveryWebhook' do + expect { instance = Freeclimb::MessageDeliveryWebhook.new( + request_type: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + status: "TS", + + phone_number_id: "TS", + + uri: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::MessageDeliveryWebhook.new( + request_type: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + status: "TS", + + phone_number_id: "TS", + + uri: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::MessageDeliveryWebhook.new( + request_type: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + status: "TS", + + phone_number_id: "TS", + + uri: "TS", + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::MessageDeliveryWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::MessageDeliveryWebhook.new( + request_type: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + status: "TS", + + phone_number_id: "TS", + + uri: "TS", + + ) + instance_2 = Freeclimb::MessageDeliveryWebhook.new( + request_type: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + status: "TS", + + phone_number_id: "TS", + + uri: "TS", + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::MessageDeliveryWebhook.new( + request_type: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + status: "TS", + + phone_number_id: "TS", + + uri: "TS", + + ) + instance_2 = Freeclimb::MessageDeliveryWebhook.new( + request_type: "ST", + + account_id: "ST", + + from: "ST", + + to: "ST", + + text: "ST", + + direction: "ST", + + application_id: "ST", + + status: "ST", + + phone_number_id: "ST", + + uri: "ST", + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::MessageDeliveryWebhook.new( + request_type: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + status: "TS", + + phone_number_id: "TS", + + uri: "TS", + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::MessageDeliveryWebhook.new( + request_type: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + status: "TS", + + phone_number_id: "TS", + + uri: "TS", + + ) + instance_2 = Freeclimb::MessageDeliveryWebhook.new( + request_type: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + status: "TS", + + phone_number_id: "TS", + + uri: "TS", + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::MessageDeliveryWebhook.new( + request_type: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + status: "TS", + + phone_number_id: "TS", + + uri: "TS", + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of text' do + expect(instance._deserialize("String", instance.text)).to be_a_kind_of(String) + end + it 'deserializes the data of direction' do + expect(instance._deserialize("String", instance.direction)).to be_a_kind_of(String) + end + it 'deserializes the data of application_id' do + expect(instance._deserialize("String", instance.application_id)).to be_a_kind_of(String) + end + it 'deserializes the data of status' do + expect(instance._deserialize("String", instance.status)).to be_a_kind_of(String) + end + it 'deserializes the data of phone_number_id' do + expect(instance._deserialize("String", instance.phone_number_id)).to be_a_kind_of(String) + end + it 'deserializes the data of uri' do + expect(instance._deserialize("String", instance.uri)).to be_a_kind_of(String) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::MessageDeliveryWebhook.new( + request_type: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + status: "TS", + + phone_number_id: "TS", + + uri: "TS", + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::MessageDeliveryWebhook.new( + request_type: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + status: "TS", + + phone_number_id: "TS", + + uri: "TS", + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::MessageDeliveryWebhook.new( + request_type: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + status: "TS", + + phone_number_id: "TS", + + uri: "TS", + + ) + instance_2 = Freeclimb::MessageDeliveryWebhook.new( + request_type: "TS", + + account_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + status: "TS", + + phone_number_id: "TS", + + uri: "TS", + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::MessageDeliveryWebhook.new( + request_type: "TS", + + + account_id: "TS", + + + from: "TS", + + + to: "TS", + + + text: "TS", + + + direction: "TS", + + + application_id: "TS", + + + status: "TS", + + + phone_number_id: "TS", + + + uri: "TS", + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns text in the form of hash' do + expect(instance._to_hash(instance.text)).to eq(instance.text) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns application_id in the form of hash' do + expect(instance._to_hash(instance.application_id)).to eq(instance.application_id) + end + it 'returns status in the form of hash' do + expect(instance._to_hash(instance.status)).to eq(instance.status) + end + it 'returns phone_number_id in the form of hash' do + expect(instance._to_hash(instance.phone_number_id)).to eq(instance.phone_number_id) + end + it 'returns uri in the form of hash' do + expect(instance._to_hash(instance.uri)).to eq(instance.uri) + end + end + +end diff --git a/spec/models/message_direction_spec.rb b/spec/models/message_direction_spec.rb index f588d8d6..fe838ea6 100644 --- a/spec/models/message_direction_spec.rb +++ b/spec/models/message_direction_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/message_request_spec.rb b/spec/models/message_request_spec.rb index 03e87ac1..24ced458 100644 --- a/spec/models/message_request_spec.rb +++ b/spec/models/message_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -102,45 +102,72 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::MessageRequest.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - from: "TS", - to: "TS", - text: "TS", - notification_url: "TS", - media_urls: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::MessageRequest.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + from: "TS", + + to: "TS", + + text: "TS", + + notification_url: "TS", + + media_urls: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::MessageRequest' do - expect{instance = Freeclimb::MessageRequest.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - from: "TS", - to: "TS", - text: "TS", - notification_url: "TS", - media_urls: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::MessageRequest.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + from: "TS", + + to: "TS", + + text: "TS", + + notification_url: "TS", + + media_urls: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::MessageRequest.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - from: "TS", - to: "TS", - text: "TS", - notification_url: "TS", - media_urls: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::MessageRequest.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + from: "TS", + + to: "TS", + + text: "TS", + + notification_url: "TS", + + media_urls: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -148,14 +175,23 @@ it 'checks if properties are valid' do instance = Freeclimb::MessageRequest.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + from: "TS", + to: "TS", + text: "TS", + notification_url: "TS", + media_urls: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -175,25 +211,43 @@ obj = Object.new() instance_1 = Freeclimb::MessageRequest.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + from: "TS", + to: "TS", + text: "TS", + notification_url: "TS", + media_urls: [], + ) instance_2 = Freeclimb::MessageRequest.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + from: "TS", + to: "TS", + text: "TS", + notification_url: "TS", + media_urls: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -201,25 +255,43 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::MessageRequest.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 2, + from: "TS", + to: "TS", + text: "TS", + notification_url: "TS", + media_urls: [], + ) instance_2 = Freeclimb::MessageRequest.new( uri: "ST", + date_created: "ST", + date_updated: "ST", + revision: 1, + from: "ST", + to: "ST", + text: "ST", + notification_url: "ST", + media_urls: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -229,16 +301,25 @@ it 'calculates hash code' do instance = Freeclimb::MessageRequest.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + from: "TS", + to: "TS", + text: "TS", + notification_url: "TS", + media_urls: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -246,16 +327,45 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::MessageRequest.new( uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + from: "TS", + + to: "TS", + + text: "TS", + + notification_url: "TS", + + media_urls: Array.new(), + + ) + instance_2 = Freeclimb::MessageRequest.new( + uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + from: "TS", + to: "TS", + text: "TS", + notification_url: "TS", + media_urls: Array.new(), + ) - instance_2 = Freeclimb::MessageRequest.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -263,14 +373,23 @@ describe 'test method "_deserialize"' do instance = Freeclimb::MessageRequest.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + from: "TS", + to: "TS", + text: "TS", + notification_url: "TS", + media_urls: Array.new(), + ) it 'deserializes the data of uri' do expect(instance._deserialize("String", instance.uri)).to be_a_kind_of(String) @@ -305,14 +424,23 @@ it 'returns the string representation of the object' do instance = Freeclimb::MessageRequest.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + from: "TS", + to: "TS", + text: "TS", + notification_url: "TS", + media_urls: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -322,14 +450,23 @@ it 'returns the object in the form of hash' do instance = Freeclimb::MessageRequest.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + from: "TS", + to: "TS", + text: "TS", + notification_url: "TS", + media_urls: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -337,25 +474,43 @@ obj = Object.new() instance_1 = Freeclimb::MessageRequest.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + from: "TS", + to: "TS", + text: "TS", + notification_url: "TS", + media_urls: Array.new(), + ) instance_2 = Freeclimb::MessageRequest.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + from: "TS", + to: "TS", + text: "TS", + notification_url: "TS", + media_urls: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -364,22 +519,31 @@ describe 'test method "_to_hash"' do instance = Freeclimb::MessageRequest.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + from: "TS", + to: "TS", + text: "TS", + notification_url: "TS", + media_urls: Array.new(), + ) it 'returns uri in the form of hash' do expect(instance._to_hash(instance.uri)).to eq(instance.uri) diff --git a/spec/models/message_result_spec.rb b/spec/models/message_result_spec.rb index d134ce66..c82ae973 100644 --- a/spec/models/message_result_spec.rb +++ b/spec/models/message_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -123,7 +123,6 @@ expect(instance.status).to eq(Freeclimb::MessageStatus::UNKNOWN) end end - describe 'test attribute "from"' do it 'should work' do instance.from = "TEST_STRING" @@ -200,63 +199,114 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::MessageResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - account_id: "TS", - message_id: "TS", - status: "NEW", - from: "TS", - to: "TS", - text: "TS", - direction: "TS", - notification_url: "TS", - brand_id: "TS", - campaign_id: "TS", - media_urls: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::MessageResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + message_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + notification_url: "TS", + + brand_id: "TS", + + campaign_id: "TS", + + + media_urls: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::MessageResult' do - expect{instance = Freeclimb::MessageResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - account_id: "TS", - message_id: "TS", - status: "NEW", - from: "TS", - to: "TS", - text: "TS", - direction: "TS", - notification_url: "TS", - brand_id: "TS", - campaign_id: "TS", - media_urls: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::MessageResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + message_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + notification_url: "TS", + + brand_id: "TS", + + campaign_id: "TS", + + + media_urls: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::MessageResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - account_id: "TS", - message_id: "TS", - status: "NEW", - from: "TS", - to: "TS", - text: "TS", - direction: "TS", - notification_url: "TS", - brand_id: "TS", - campaign_id: "TS", - media_urls: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::MessageResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + message_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + notification_url: "TS", + + brand_id: "TS", + + campaign_id: "TS", + + + media_urls: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -264,21 +314,38 @@ it 'checks if properties are valid' do instance = Freeclimb::MessageResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + message_id: "TS", - status: "NEW", + + + status: Freeclimb::MessageStatus::NEW, + from: "TS", + to: "TS", + text: "TS", + direction: "TS", + notification_url: "TS", + brand_id: "TS", + campaign_id: "TS", + segment_count: 1, + media_urls: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -298,39 +365,71 @@ obj = Object.new() instance_1 = Freeclimb::MessageResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + message_id: "TS", - status: Freeclimb::MessageStatus.new(), - status: "NEW", + + + status: Freeclimb::MessageStatus::NEW, + from: "TS", + to: "TS", + text: "TS", + direction: "TS", + notification_url: "TS", + brand_id: "TS", + campaign_id: "TS", + + media_urls: [], + ) instance_2 = Freeclimb::MessageResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + message_id: "TS", - status: Freeclimb::MessageStatus.new(), - status: "NEW", + + + status: Freeclimb::MessageStatus::NEW, + from: "TS", + to: "TS", + text: "TS", + direction: "TS", + notification_url: "TS", + brand_id: "TS", + campaign_id: "TS", + + media_urls: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -338,39 +437,71 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::MessageResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 2, + account_id: "TS", + message_id: "TS", - status: Freeclimb::MessageStatus.new(), - status: "NEW", + + + status: Freeclimb::MessageStatus::NEW, + from: "TS", + to: "TS", + text: "TS", + direction: "TS", + notification_url: "TS", + brand_id: "TS", + campaign_id: "TS", + + media_urls: [], + ) instance_2 = Freeclimb::MessageResult.new( uri: "ST", + date_created: "ST", + date_updated: "ST", + revision: 1, + account_id: "ST", + message_id: "ST", - status: Freeclimb::MessageStatus.new(), - status: "QUEUED", + + + status: nil, + from: "ST", + to: "ST", + text: "ST", + direction: "ST", + notification_url: "ST", + brand_id: "ST", + campaign_id: "ST", + + media_urls: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -380,22 +511,39 @@ it 'calculates hash code' do instance = Freeclimb::MessageResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + message_id: "TS", - status: "NEW", + + + status: Freeclimb::MessageStatus::NEW, + from: "TS", + to: "TS", + text: "TS", + direction: "TS", + notification_url: "TS", + brand_id: "TS", + campaign_id: "TS", + + media_urls: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -403,22 +551,73 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::MessageResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + message_id: "TS", - status: "NEW", + + + status: Freeclimb::MessageStatus::NEW, + from: "TS", + to: "TS", + text: "TS", + direction: "TS", + notification_url: "TS", + brand_id: "TS", + campaign_id: "TS", + + media_urls: Array.new(), + ) - instance_2 = Freeclimb::MessageResult.new + instance_2 = Freeclimb::MessageResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + message_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + notification_url: "TS", + + brand_id: "TS", + + campaign_id: "TS", + + + media_urls: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -426,20 +625,37 @@ describe 'test method "_deserialize"' do instance = Freeclimb::MessageResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + message_id: "TS", - status: "NEW", + + + status: Freeclimb::MessageStatus::NEW, + from: "TS", + to: "TS", + text: "TS", + direction: "TS", + notification_url: "TS", + brand_id: "TS", + campaign_id: "TS", + + media_urls: Array.new(), + ) it 'deserializes the data of uri' do expect(instance._deserialize("String", instance.uri)).to be_a_kind_of(String) @@ -492,20 +708,37 @@ it 'returns the string representation of the object' do instance = Freeclimb::MessageResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + message_id: "TS", - status: "NEW", + + + status: Freeclimb::MessageStatus::NEW, + from: "TS", + to: "TS", + text: "TS", + direction: "TS", + notification_url: "TS", + brand_id: "TS", + campaign_id: "TS", + + media_urls: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -515,20 +748,37 @@ it 'returns the object in the form of hash' do instance = Freeclimb::MessageResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + message_id: "TS", - status: "NEW", + + + status: Freeclimb::MessageStatus::NEW, + from: "TS", + to: "TS", + text: "TS", + direction: "TS", + notification_url: "TS", + brand_id: "TS", + campaign_id: "TS", + + media_urls: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -536,37 +786,71 @@ obj = Object.new() instance_1 = Freeclimb::MessageResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + message_id: "TS", - status: "NEW", + + + status: Freeclimb::MessageStatus::NEW, + from: "TS", + to: "TS", + text: "TS", + direction: "TS", + notification_url: "TS", + brand_id: "TS", + campaign_id: "TS", + + media_urls: Array.new(), + ) instance_2 = Freeclimb::MessageResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + message_id: "TS", - status: "NEW", + + + status: Freeclimb::MessageStatus::NEW, + from: "TS", + to: "TS", + text: "TS", + direction: "TS", + notification_url: "TS", + brand_id: "TS", + campaign_id: "TS", + + media_urls: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -575,35 +859,52 @@ describe 'test method "_to_hash"' do instance = Freeclimb::MessageResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + message_id: "TS", + - status: "NEW", + + status: Freeclimb::MessageStatus::NEW, + from: "TS", + to: "TS", + text: "TS", + direction: "TS", + notification_url: "TS", + brand_id: "TS", + campaign_id: "TS", + + media_urls: Array.new(), + ) it 'returns uri in the form of hash' do expect(instance._to_hash(instance.uri)).to eq(instance.uri) diff --git a/spec/models/message_status_spec.rb b/spec/models/message_status_spec.rb index a224cbbd..6ae3141f 100644 --- a/spec/models/message_status_spec.rb +++ b/spec/models/message_status_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/message_status_webhook_spec.rb b/spec/models/message_status_webhook_spec.rb new file mode 100644 index 00000000..084d651b --- /dev/null +++ b/spec/models/message_status_webhook_spec.rb @@ -0,0 +1,732 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::MessageStatusWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::MessageStatusWebhook do + let(:instance) { Freeclimb::MessageStatusWebhook.new } + + describe 'test an instance of MessageStatusWebhook' do + it 'should create an instance of MessageStatusWebhook' do + expect(instance).to be_instance_of(Freeclimb::MessageStatusWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of MessageStatusWebhook' do + payload = '{ "requestType": "messageStatus" }' + expect(Freeclimb::MessageStatusWebhook.deserialize(payload)).to be_instance_of(Freeclimb::MessageStatusWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "message_id"' do + it 'should work' do + instance.message_id = "TEST_STRING" + expect(instance.message_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + describe 'test attribute "text"' do + it 'should work' do + instance.text = "TEST_STRING" + expect(instance.text).to eq("TEST_STRING") + + end + end + + describe 'test attribute "direction"' do + it 'should work' do + instance.direction = "TEST_STRING" + expect(instance.direction).to eq("TEST_STRING") + + end + end + + describe 'test attribute "application_id"' do + it 'should work' do + instance.application_id = "TEST_STRING" + expect(instance.application_id).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "status"' do + it 'assigns value NEW' do + instance.status = Freeclimb::MessageStatus::NEW + expect(instance.status).to eq(Freeclimb::MessageStatus::NEW) + end + it 'assigns value QUEUED' do + instance.status = Freeclimb::MessageStatus::QUEUED + expect(instance.status).to eq(Freeclimb::MessageStatus::QUEUED) + end + it 'assigns value REJECTED' do + instance.status = Freeclimb::MessageStatus::REJECTED + expect(instance.status).to eq(Freeclimb::MessageStatus::REJECTED) + end + it 'assigns value SENDING' do + instance.status = Freeclimb::MessageStatus::SENDING + expect(instance.status).to eq(Freeclimb::MessageStatus::SENDING) + end + it 'assigns value SENT' do + instance.status = Freeclimb::MessageStatus::SENT + expect(instance.status).to eq(Freeclimb::MessageStatus::SENT) + end + it 'assigns value FAILED' do + instance.status = Freeclimb::MessageStatus::FAILED + expect(instance.status).to eq(Freeclimb::MessageStatus::FAILED) + end + it 'assigns value RECEIVED' do + instance.status = Freeclimb::MessageStatus::RECEIVED + expect(instance.status).to eq(Freeclimb::MessageStatus::RECEIVED) + end + it 'assigns value UNDELIVERED' do + instance.status = Freeclimb::MessageStatus::UNDELIVERED + expect(instance.status).to eq(Freeclimb::MessageStatus::UNDELIVERED) + end + it 'assigns value EXPIRED' do + instance.status = Freeclimb::MessageStatus::EXPIRED + expect(instance.status).to eq(Freeclimb::MessageStatus::EXPIRED) + end + it 'assigns value DELETED' do + instance.status = Freeclimb::MessageStatus::DELETED + expect(instance.status).to eq(Freeclimb::MessageStatus::DELETED) + end + it 'assigns value UNKNOWN' do + instance.status = Freeclimb::MessageStatus::UNKNOWN + expect(instance.status).to eq(Freeclimb::MessageStatus::UNKNOWN) + end + end + describe 'test attribute "phone_number_id"' do + it 'should work' do + instance.phone_number_id = "TEST_STRING" + expect(instance.phone_number_id).to eq("TEST_STRING") + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::MessageStatusWebhook.new( + request_type: "TS", + + account_id: "TS", + + message_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + phone_number_id: "TS", + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::MessageStatusWebhook' do + expect { instance = Freeclimb::MessageStatusWebhook.new( + request_type: "TS", + + account_id: "TS", + + message_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + phone_number_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::MessageStatusWebhook.new( + request_type: "TS", + + account_id: "TS", + + message_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + phone_number_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::MessageStatusWebhook.new( + request_type: "TS", + + account_id: "TS", + + message_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + phone_number_id: "TS", + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::MessageStatusWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::MessageStatusWebhook.new( + request_type: "TS", + + account_id: "TS", + + message_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + phone_number_id: "TS", + + ) + instance_2 = Freeclimb::MessageStatusWebhook.new( + request_type: "TS", + + account_id: "TS", + + message_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + phone_number_id: "TS", + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::MessageStatusWebhook.new( + request_type: "TS", + + account_id: "TS", + + message_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + phone_number_id: "TS", + + ) + instance_2 = Freeclimb::MessageStatusWebhook.new( + request_type: "ST", + + account_id: "ST", + + message_id: "ST", + + call_id: "ST", + + from: "ST", + + to: "ST", + + text: "ST", + + direction: "ST", + + application_id: "ST", + + + status: nil, + + phone_number_id: "ST", + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::MessageStatusWebhook.new( + request_type: "TS", + + account_id: "TS", + + message_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + phone_number_id: "TS", + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::MessageStatusWebhook.new( + request_type: "TS", + + account_id: "TS", + + message_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + phone_number_id: "TS", + + ) + instance_2 = Freeclimb::MessageStatusWebhook.new( + request_type: "TS", + + account_id: "TS", + + message_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + phone_number_id: "TS", + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::MessageStatusWebhook.new( + request_type: "TS", + + account_id: "TS", + + message_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + phone_number_id: "TS", + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of message_id' do + expect(instance._deserialize("String", instance.message_id)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of text' do + expect(instance._deserialize("String", instance.text)).to be_a_kind_of(String) + end + it 'deserializes the data of direction' do + expect(instance._deserialize("String", instance.direction)).to be_a_kind_of(String) + end + it 'deserializes the data of application_id' do + expect(instance._deserialize("String", instance.application_id)).to be_a_kind_of(String) + end + it 'deserializes the data of phone_number_id' do + expect(instance._deserialize("String", instance.phone_number_id)).to be_a_kind_of(String) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::MessageStatusWebhook.new( + request_type: "TS", + + account_id: "TS", + + message_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + phone_number_id: "TS", + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::MessageStatusWebhook.new( + request_type: "TS", + + account_id: "TS", + + message_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + phone_number_id: "TS", + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::MessageStatusWebhook.new( + request_type: "TS", + + account_id: "TS", + + message_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + phone_number_id: "TS", + + ) + instance_2 = Freeclimb::MessageStatusWebhook.new( + request_type: "TS", + + account_id: "TS", + + message_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + text: "TS", + + direction: "TS", + + application_id: "TS", + + + status: Freeclimb::MessageStatus::NEW, + + phone_number_id: "TS", + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::MessageStatusWebhook.new( + request_type: "TS", + + + account_id: "TS", + + + message_id: "TS", + + + call_id: "TS", + + + from: "TS", + + + to: "TS", + + + text: "TS", + + + direction: "TS", + + + application_id: "TS", + + + + status: Freeclimb::MessageStatus::NEW, + + + phone_number_id: "TS", + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns message_id in the form of hash' do + expect(instance._to_hash(instance.message_id)).to eq(instance.message_id) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns text in the form of hash' do + expect(instance._to_hash(instance.text)).to eq(instance.text) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns application_id in the form of hash' do + expect(instance._to_hash(instance.application_id)).to eq(instance.application_id) + end + it 'returns status in the form of hash' do + expect(instance._to_hash(instance.status)).to eq(instance.status) + end + it 'returns phone_number_id in the form of hash' do + expect(instance._to_hash(instance.phone_number_id)).to eq(instance.phone_number_id) + end + end + +end diff --git a/spec/models/messages_list_spec.rb b/spec/models/messages_list_spec.rb index c829d3da..d0e5de85 100644 --- a/spec/models/messages_list_spec.rb +++ b/spec/models/messages_list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,42 +104,66 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::MessagesList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - messages: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::MessagesList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + messages: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::MessagesList' do - expect{instance = Freeclimb::MessagesList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - messages: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::MessagesList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + messages: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::MessagesList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - messages: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::MessagesList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + messages: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -147,13 +171,21 @@ it 'checks if properties are valid' do instance = Freeclimb::MessagesList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + messages: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -173,25 +205,39 @@ obj = Object.new() instance_1 = Freeclimb::MessagesList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - messages: Freeclimb::MessageResult.new(), + messages: [], + ) instance_2 = Freeclimb::MessagesList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - messages: Freeclimb::MessageResult.new(), + messages: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,25 +245,39 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::MessagesList.new( total: 2, + start: 2, + _end: 2, + page: 2, + num_pages: 2, + page_size: 2, + next_page_uri: "TS", - messages: Freeclimb::MessageResult.new(), + messages: [], + ) instance_2 = Freeclimb::MessagesList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "ST", - messages: Freeclimb::MessageResult.new(), + messages: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -227,15 +287,23 @@ it 'calculates hash code' do instance = Freeclimb::MessagesList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + messages: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -243,15 +311,41 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::MessagesList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + messages: Array.new(), + ) - instance_2 = Freeclimb::MessagesList.new + instance_2 = Freeclimb::MessagesList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + messages: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -259,13 +353,21 @@ describe 'test method "_deserialize"' do instance = Freeclimb::MessagesList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + messages: Array.new(), + ) it 'deserializes the data of total' do expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) @@ -297,13 +399,21 @@ it 'returns the string representation of the object' do instance = Freeclimb::MessagesList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + messages: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -313,13 +423,21 @@ it 'returns the object in the form of hash' do instance = Freeclimb::MessagesList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + messages: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -327,23 +445,39 @@ obj = Object.new() instance_1 = Freeclimb::MessagesList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + messages: Array.new(), + ) instance_2 = Freeclimb::MessagesList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + messages: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -352,20 +486,28 @@ describe 'test method "_to_hash"' do instance = Freeclimb::MessagesList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + messages: Array.new(), + ) it 'returns total in the form of hash' do expect(instance._to_hash(instance.total)).to eq(instance.total) diff --git a/spec/models/mutable_resource_model_spec.rb b/spec/models/mutable_resource_model_spec.rb index eefb475c..6f1f479c 100644 --- a/spec/models/mutable_resource_model_spec.rb +++ b/spec/models/mutable_resource_model_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -62,30 +62,42 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::MutableResourceModel.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - )}.not_to raise_error() + expect { instance = Freeclimb::MutableResourceModel.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::MutableResourceModel' do - expect{instance = Freeclimb::MutableResourceModel.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::MutableResourceModel.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::MutableResourceModel.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::MutableResourceModel.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -93,9 +105,13 @@ it 'checks if properties are valid' do instance = Freeclimb::MutableResourceModel.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + ) expect(instance.valid?).to eq(true) end @@ -115,15 +131,23 @@ obj = Object.new() instance_1 = Freeclimb::MutableResourceModel.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + ) instance_2 = Freeclimb::MutableResourceModel.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -131,15 +155,23 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::MutableResourceModel.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 2, + ) instance_2 = Freeclimb::MutableResourceModel.new( uri: "ST", + date_created: "ST", + date_updated: "ST", + revision: 1, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -149,11 +181,15 @@ it 'calculates hash code' do instance = Freeclimb::MutableResourceModel.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -161,11 +197,25 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::MutableResourceModel.new( uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + ) + instance_2 = Freeclimb::MutableResourceModel.new( + uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + ) - instance_2 = Freeclimb::MutableResourceModel.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -173,9 +223,13 @@ describe 'test method "_deserialize"' do instance = Freeclimb::MutableResourceModel.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + ) it 'deserializes the data of uri' do expect(instance._deserialize("String", instance.uri)).to be_a_kind_of(String) @@ -195,9 +249,13 @@ it 'returns the string representation of the object' do instance = Freeclimb::MutableResourceModel.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -207,9 +265,13 @@ it 'returns the object in the form of hash' do instance = Freeclimb::MutableResourceModel.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -217,15 +279,23 @@ obj = Object.new() instance_1 = Freeclimb::MutableResourceModel.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + ) instance_2 = Freeclimb::MutableResourceModel.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -234,12 +304,16 @@ describe 'test method "_to_hash"' do instance = Freeclimb::MutableResourceModel.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + ) it 'returns uri in the form of hash' do expect(instance._to_hash(instance.uri)).to eq(instance.uri) diff --git a/spec/models/out_dial_api_connect_webhook_spec.rb b/spec/models/out_dial_api_connect_webhook_spec.rb new file mode 100644 index 00000000..b366e608 --- /dev/null +++ b/spec/models/out_dial_api_connect_webhook_spec.rb @@ -0,0 +1,692 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::OutDialApiConnectWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::OutDialApiConnectWebhook do + let(:instance) { Freeclimb::OutDialApiConnectWebhook.new } + + describe 'test an instance of OutDialApiConnectWebhook' do + it 'should create an instance of OutDialApiConnectWebhook' do + expect(instance).to be_instance_of(Freeclimb::OutDialApiConnectWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of OutDialApiConnectWebhook' do + payload = '{ "requestType": "outDialApiConnect" }' + expect(Freeclimb::OutDialApiConnectWebhook.deserialize(payload)).to be_instance_of(Freeclimb::OutDialApiConnectWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "parent_call_id"' do + it 'should work' do + instance.parent_call_id = "TEST_STRING" + expect(instance.parent_call_id).to eq("TEST_STRING") + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::OutDialApiConnectWebhook' do + expect { instance = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::OutDialApiConnectWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "ST", + + account_id: "ST", + + call_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + parent_call_id: "ST", + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + it 'deserializes the data of parent_call_id' do + expect(instance._deserialize("String", instance.parent_call_id)).to be_a_kind_of(String) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::OutDialApiConnectWebhook.new( + request_type: "TS", + + + account_id: "TS", + + + call_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + + parent_call_id: "TS", + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + it 'returns parent_call_id in the form of hash' do + expect(instance._to_hash(instance.parent_call_id)).to eq(instance.parent_call_id) + end + end + +end diff --git a/spec/models/out_dial_connect_webhook_spec.rb b/spec/models/out_dial_connect_webhook_spec.rb new file mode 100644 index 00000000..0335c66d --- /dev/null +++ b/spec/models/out_dial_connect_webhook_spec.rb @@ -0,0 +1,692 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::OutDialConnectWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::OutDialConnectWebhook do + let(:instance) { Freeclimb::OutDialConnectWebhook.new } + + describe 'test an instance of OutDialConnectWebhook' do + it 'should create an instance of OutDialConnectWebhook' do + expect(instance).to be_instance_of(Freeclimb::OutDialConnectWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of OutDialConnectWebhook' do + payload = '{ "requestType": "outDialConnect" }' + expect(Freeclimb::OutDialConnectWebhook.deserialize(payload)).to be_instance_of(Freeclimb::OutDialConnectWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "parent_call_id"' do + it 'should work' do + instance.parent_call_id = "TEST_STRING" + expect(instance.parent_call_id).to eq("TEST_STRING") + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::OutDialConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::OutDialConnectWebhook' do + expect { instance = Freeclimb::OutDialConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::OutDialConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::OutDialConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::OutDialConnectWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::OutDialConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::OutDialConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::OutDialConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::OutDialConnectWebhook.new( + request_type: "ST", + + account_id: "ST", + + call_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + parent_call_id: "ST", + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::OutDialConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::OutDialConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::OutDialConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::OutDialConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + it 'deserializes the data of parent_call_id' do + expect(instance._deserialize("String", instance.parent_call_id)).to be_a_kind_of(String) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::OutDialConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::OutDialConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::OutDialConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::OutDialConnectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::OutDialConnectWebhook.new( + request_type: "TS", + + + account_id: "TS", + + + call_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + + parent_call_id: "TS", + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + it 'returns parent_call_id in the form of hash' do + expect(instance._to_hash(instance.parent_call_id)).to eq(instance.parent_call_id) + end + end + +end diff --git a/spec/models/out_dial_spec.rb b/spec/models/out_dial_spec.rb index abb69e9b..e283cda5 100644 --- a/spec/models/out_dial_spec.rb +++ b/spec/models/out_dial_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -69,7 +69,6 @@ expect(instance.if_machine).to eq(Freeclimb::IfMachine::HANGUP) end end - describe 'test attribute "if_machine_url"' do it 'should work' do instance.if_machine_url = "TEST_STRING" @@ -114,48 +113,81 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::OutDial.new( - action_url: "TS", - call_connect_url: "TS", - calling_number: "TS", - destination: "TS", - if_machine: "REDIRECT", - if_machine_url: "TS", - send_digits: "TS", - status_callback_url: "TS", - timeout: 1, - privacy_mode: true, - )}.not_to raise_error() + expect { instance = Freeclimb::OutDial.new( + action_url: "TS", + + call_connect_url: "TS", + + calling_number: "TS", + + destination: "TS", + + + if_machine: Freeclimb::IfMachine::REDIRECT, + + if_machine_url: "TS", + + send_digits: "TS", + + status_callback_url: "TS", + + timeout: 1, + + privacy_mode: true, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::OutDial' do - expect{instance = Freeclimb::OutDial.new( - action_url: "TS", - call_connect_url: "TS", - calling_number: "TS", - destination: "TS", - if_machine: "REDIRECT", - if_machine_url: "TS", - send_digits: "TS", - status_callback_url: "TS", - timeout: 1, - privacy_mode: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::OutDial.new( + action_url: "TS", + + call_connect_url: "TS", + + calling_number: "TS", + + destination: "TS", + + + if_machine: Freeclimb::IfMachine::REDIRECT, + + if_machine_url: "TS", + + send_digits: "TS", + + status_callback_url: "TS", + + timeout: 1, + + privacy_mode: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::OutDial.new( - action_url: "TS", - call_connect_url: "TS", - calling_number: "TS", - destination: "TS", - if_machine: "REDIRECT", - if_machine_url: "TS", - send_digits: "TS", - status_callback_url: "TS", - timeout: 1, - privacy_mode: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::OutDial.new( + action_url: "TS", + + call_connect_url: "TS", + + calling_number: "TS", + + destination: "TS", + + + if_machine: Freeclimb::IfMachine::REDIRECT, + + if_machine_url: "TS", + + send_digits: "TS", + + status_callback_url: "TS", + + timeout: 1, + + privacy_mode: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -163,15 +195,26 @@ it 'checks if properties are valid' do instance = Freeclimb::OutDial.new( action_url: "TS", + call_connect_url: "TS", + calling_number: "TS", + destination: "TS", - if_machine: "REDIRECT", + + + if_machine: Freeclimb::IfMachine::REDIRECT, + if_machine_url: "TS", + send_digits: "TS", + status_callback_url: "TS", + timeout: 1, + privacy_mode: true, + ) expect(instance.valid?).to eq(true) end @@ -191,29 +234,49 @@ obj = Object.new() instance_1 = Freeclimb::OutDial.new( action_url: "TS", + call_connect_url: "TS", + calling_number: "TS", + destination: "TS", - if_machine: Freeclimb::IfMachine.new(), - if_machine: "REDIRECT", + + + if_machine: Freeclimb::IfMachine::REDIRECT, + if_machine_url: "TS", + send_digits: "TS", + status_callback_url: "TS", + timeout: 1, + privacy_mode: true, + ) instance_2 = Freeclimb::OutDial.new( action_url: "TS", + call_connect_url: "TS", + calling_number: "TS", + destination: "TS", - if_machine: Freeclimb::IfMachine.new(), - if_machine: "REDIRECT", + + + if_machine: Freeclimb::IfMachine::REDIRECT, + if_machine_url: "TS", + send_digits: "TS", + status_callback_url: "TS", + timeout: 1, + privacy_mode: true, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -221,29 +284,49 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::OutDial.new( action_url: "TS", + call_connect_url: "TS", + calling_number: "TS", + destination: "TS", - if_machine: Freeclimb::IfMachine.new(), - if_machine: "REDIRECT", + + + if_machine: Freeclimb::IfMachine::REDIRECT, + if_machine_url: "TS", + send_digits: "TS", + status_callback_url: "TS", + timeout: 2, + privacy_mode: true, + ) instance_2 = Freeclimb::OutDial.new( action_url: "ST", + call_connect_url: "ST", + calling_number: "ST", + destination: "ST", - if_machine: Freeclimb::IfMachine.new(), - if_machine: "HANGUP", + + + if_machine: nil, + if_machine_url: "ST", + send_digits: "ST", + status_callback_url: "ST", + timeout: 1, + privacy_mode: false, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -253,17 +336,28 @@ it 'calculates hash code' do instance = Freeclimb::OutDial.new( action_url: "TS", + call_connect_url: "TS", + calling_number: "TS", + destination: "TS", - if_machine: "REDIRECT", + + + if_machine: Freeclimb::IfMachine::REDIRECT, + if_machine_url: "TS", + send_digits: "TS", + status_callback_url: "TS", + timeout: 1, + privacy_mode: true, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -271,17 +365,51 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::OutDial.new( action_url: "TS", + call_connect_url: "TS", + calling_number: "TS", + destination: "TS", - if_machine: "REDIRECT", + + + if_machine: Freeclimb::IfMachine::REDIRECT, + + if_machine_url: "TS", + + send_digits: "TS", + + status_callback_url: "TS", + + timeout: 1, + + privacy_mode: true, + + ) + instance_2 = Freeclimb::OutDial.new( + action_url: "TS", + + call_connect_url: "TS", + + calling_number: "TS", + + destination: "TS", + + + if_machine: Freeclimb::IfMachine::REDIRECT, + if_machine_url: "TS", + send_digits: "TS", + status_callback_url: "TS", + timeout: 1, + privacy_mode: true, + ) - instance_2 = Freeclimb::OutDial.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -289,15 +417,26 @@ describe 'test method "_deserialize"' do instance = Freeclimb::OutDial.new( action_url: "TS", + call_connect_url: "TS", + calling_number: "TS", + destination: "TS", - if_machine: "REDIRECT", + + + if_machine: Freeclimb::IfMachine::REDIRECT, + if_machine_url: "TS", + send_digits: "TS", + status_callback_url: "TS", + timeout: 1, + privacy_mode: true, + ) it 'deserializes the data of action_url' do expect(instance._deserialize("String", instance.action_url)).to be_a_kind_of(String) @@ -332,15 +471,26 @@ it 'returns the string representation of the object' do instance = Freeclimb::OutDial.new( action_url: "TS", + call_connect_url: "TS", + calling_number: "TS", + destination: "TS", - if_machine: "REDIRECT", + + + if_machine: Freeclimb::IfMachine::REDIRECT, + if_machine_url: "TS", + send_digits: "TS", + status_callback_url: "TS", + timeout: 1, + privacy_mode: true, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -350,15 +500,26 @@ it 'returns the object in the form of hash' do instance = Freeclimb::OutDial.new( action_url: "TS", + call_connect_url: "TS", + calling_number: "TS", + destination: "TS", - if_machine: "REDIRECT", + + + if_machine: Freeclimb::IfMachine::REDIRECT, + if_machine_url: "TS", + send_digits: "TS", + status_callback_url: "TS", + timeout: 1, + privacy_mode: true, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -366,27 +527,49 @@ obj = Object.new() instance_1 = Freeclimb::OutDial.new( action_url: "TS", + call_connect_url: "TS", + calling_number: "TS", + destination: "TS", - if_machine: "REDIRECT", + + + if_machine: Freeclimb::IfMachine::REDIRECT, + if_machine_url: "TS", + send_digits: "TS", + status_callback_url: "TS", + timeout: 1, + privacy_mode: true, + ) instance_2 = Freeclimb::OutDial.new( action_url: "TS", + call_connect_url: "TS", + calling_number: "TS", + destination: "TS", - if_machine: "REDIRECT", + + + if_machine: Freeclimb::IfMachine::REDIRECT, + if_machine_url: "TS", + send_digits: "TS", + status_callback_url: "TS", + timeout: 1, + privacy_mode: true, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -395,24 +578,35 @@ describe 'test method "_to_hash"' do instance = Freeclimb::OutDial.new( action_url: "TS", + call_connect_url: "TS", + calling_number: "TS", + destination: "TS", + - if_machine: "REDIRECT", + + if_machine: Freeclimb::IfMachine::REDIRECT, + if_machine_url: "TS", + send_digits: "TS", + status_callback_url: "TS", + timeout: 1, + privacy_mode: true, + ) it 'returns action_url in the form of hash' do expect(instance._to_hash(instance.action_url)).to eq(instance.action_url) diff --git a/spec/models/out_dial_start_webhook_spec.rb b/spec/models/out_dial_start_webhook_spec.rb new file mode 100644 index 00000000..05541711 --- /dev/null +++ b/spec/models/out_dial_start_webhook_spec.rb @@ -0,0 +1,741 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::OutDialStartWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::OutDialStartWebhook do + let(:instance) { Freeclimb::OutDialStartWebhook.new } + + describe 'test an instance of OutDialStartWebhook' do + it 'should create an instance of OutDialStartWebhook' do + expect(instance).to be_instance_of(Freeclimb::OutDialStartWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of OutDialStartWebhook' do + payload = '{ "requestType": "outDialStart" }' + expect(Freeclimb::OutDialStartWebhook.deserialize(payload)).to be_instance_of(Freeclimb::OutDialStartWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "dial_call_id"' do + it 'should work' do + instance.dial_call_id = "TEST_STRING" + expect(instance.dial_call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "parent_call_id"' do + it 'should work' do + instance.parent_call_id = "TEST_STRING" + expect(instance.parent_call_id).to eq("TEST_STRING") + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::OutDialStartWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + dial_call_id: "TS", + + parent_call_id: "TS", + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::OutDialStartWebhook' do + expect { instance = Freeclimb::OutDialStartWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + dial_call_id: "TS", + + parent_call_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::OutDialStartWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + dial_call_id: "TS", + + parent_call_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::OutDialStartWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + dial_call_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::OutDialStartWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::OutDialStartWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + dial_call_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::OutDialStartWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + dial_call_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::OutDialStartWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + dial_call_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::OutDialStartWebhook.new( + request_type: "ST", + + account_id: "ST", + + call_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + dial_call_id: "ST", + + parent_call_id: "ST", + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::OutDialStartWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + dial_call_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::OutDialStartWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + dial_call_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::OutDialStartWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + dial_call_id: "TS", + + parent_call_id: "TS", + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::OutDialStartWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + dial_call_id: "TS", + + parent_call_id: "TS", + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + it 'deserializes the data of dial_call_id' do + expect(instance._deserialize("String", instance.dial_call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of parent_call_id' do + expect(instance._deserialize("String", instance.parent_call_id)).to be_a_kind_of(String) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::OutDialStartWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + dial_call_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::OutDialStartWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + dial_call_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::OutDialStartWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + dial_call_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::OutDialStartWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + dial_call_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::OutDialStartWebhook.new( + request_type: "TS", + + + account_id: "TS", + + + call_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + + dial_call_id: "TS", + + + parent_call_id: "TS", + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + it 'returns dial_call_id in the form of hash' do + expect(instance._to_hash(instance.dial_call_id)).to eq(instance.dial_call_id) + end + it 'returns parent_call_id in the form of hash' do + expect(instance._to_hash(instance.parent_call_id)).to eq(instance.parent_call_id) + end + end + +end diff --git a/spec/models/pagination_model_spec.rb b/spec/models/pagination_model_spec.rb index 7cd16786..8908c532 100644 --- a/spec/models/pagination_model_spec.rb +++ b/spec/models/pagination_model_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -96,39 +96,60 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::PaginationModel.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::PaginationModel.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::PaginationModel' do - expect{instance = Freeclimb::PaginationModel.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::PaginationModel.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::PaginationModel.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::PaginationModel.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -136,12 +157,19 @@ it 'checks if properties are valid' do instance = Freeclimb::PaginationModel.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + ) expect(instance.valid?).to eq(true) end @@ -161,21 +189,35 @@ obj = Object.new() instance_1 = Freeclimb::PaginationModel.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + ) instance_2 = Freeclimb::PaginationModel.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -183,21 +225,35 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::PaginationModel.new( total: 2, + start: 2, + _end: 2, + page: 2, + num_pages: 2, + page_size: 2, + next_page_uri: "TS", + ) instance_2 = Freeclimb::PaginationModel.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -207,14 +263,21 @@ it 'calculates hash code' do instance = Freeclimb::PaginationModel.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -222,14 +285,37 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::PaginationModel.new( total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + ) + instance_2 = Freeclimb::PaginationModel.new( + total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + ) - instance_2 = Freeclimb::PaginationModel.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -237,12 +323,19 @@ describe 'test method "_deserialize"' do instance = Freeclimb::PaginationModel.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + ) it 'deserializes the data of total' do expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) @@ -271,12 +364,19 @@ it 'returns the string representation of the object' do instance = Freeclimb::PaginationModel.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -286,12 +386,19 @@ it 'returns the object in the form of hash' do instance = Freeclimb::PaginationModel.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -299,21 +406,35 @@ obj = Object.new() instance_1 = Freeclimb::PaginationModel.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + ) instance_2 = Freeclimb::PaginationModel.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -322,18 +443,25 @@ describe 'test method "_to_hash"' do instance = Freeclimb::PaginationModel.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + ) it 'returns total in the form of hash' do expect(instance._to_hash(instance.total)).to eq(instance.total) diff --git a/spec/models/park_spec.rb b/spec/models/park_spec.rb index 06395b86..d392956d 100644 --- a/spec/models/park_spec.rb +++ b/spec/models/park_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -52,27 +52,36 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::Park.new( - wait_url: "TS", - action_url: "TS", - notification_url: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::Park.new( + wait_url: "TS", + + action_url: "TS", + + notification_url: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::Park' do - expect{instance = Freeclimb::Park.new( - wait_url: "TS", - action_url: "TS", - notification_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Park.new( + wait_url: "TS", + + action_url: "TS", + + notification_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::Park.new( - wait_url: "TS", - action_url: "TS", - notification_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Park.new( + wait_url: "TS", + + action_url: "TS", + + notification_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -80,8 +89,11 @@ it 'checks if properties are valid' do instance = Freeclimb::Park.new( wait_url: "TS", + action_url: "TS", + notification_url: "TS", + ) expect(instance.valid?).to eq(true) end @@ -101,13 +113,19 @@ obj = Object.new() instance_1 = Freeclimb::Park.new( wait_url: "TS", + action_url: "TS", + notification_url: "TS", + ) instance_2 = Freeclimb::Park.new( wait_url: "TS", + action_url: "TS", + notification_url: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -115,13 +133,19 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::Park.new( wait_url: "TS", + action_url: "TS", + notification_url: "TS", + ) instance_2 = Freeclimb::Park.new( wait_url: "ST", + action_url: "ST", + notification_url: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -131,10 +155,13 @@ it 'calculates hash code' do instance = Freeclimb::Park.new( wait_url: "TS", + action_url: "TS", + notification_url: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -142,10 +169,21 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::Park.new( wait_url: "TS", + action_url: "TS", + notification_url: "TS", + ) - instance_2 = Freeclimb::Park.new + instance_2 = Freeclimb::Park.new( + wait_url: "TS", + + action_url: "TS", + + notification_url: "TS", + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -153,8 +191,11 @@ describe 'test method "_deserialize"' do instance = Freeclimb::Park.new( wait_url: "TS", + action_url: "TS", + notification_url: "TS", + ) it 'deserializes the data of wait_url' do expect(instance._deserialize("String", instance.wait_url)).to be_a_kind_of(String) @@ -171,8 +212,11 @@ it 'returns the string representation of the object' do instance = Freeclimb::Park.new( wait_url: "TS", + action_url: "TS", + notification_url: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -182,8 +226,11 @@ it 'returns the object in the form of hash' do instance = Freeclimb::Park.new( wait_url: "TS", + action_url: "TS", + notification_url: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -191,13 +238,19 @@ obj = Object.new() instance_1 = Freeclimb::Park.new( wait_url: "TS", + action_url: "TS", + notification_url: "TS", + ) instance_2 = Freeclimb::Park.new( wait_url: "TS", + action_url: "TS", + notification_url: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -206,10 +259,13 @@ describe 'test method "_to_hash"' do instance = Freeclimb::Park.new( wait_url: "TS", + action_url: "TS", + notification_url: "TS", + ) it 'returns wait_url in the form of hash' do expect(instance._to_hash(instance.wait_url)).to eq(instance.wait_url) diff --git a/spec/models/pause_spec.rb b/spec/models/pause_spec.rb index fa5f5cf6..bdfcfb8a 100644 --- a/spec/models/pause_spec.rb +++ b/spec/models/pause_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -38,21 +38,24 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::Pause.new( - length: 1, - )}.not_to raise_error() + expect { instance = Freeclimb::Pause.new( + length: 1, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::Pause' do - expect{instance = Freeclimb::Pause.new( - length: 1, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Pause.new( + length: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::Pause.new( - length: 1, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Pause.new( + length: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -60,6 +63,7 @@ it 'checks if properties are valid' do instance = Freeclimb::Pause.new( length: 1, + ) expect(instance.valid?).to eq(true) end @@ -79,9 +83,11 @@ obj = Object.new() instance_1 = Freeclimb::Pause.new( length: 1, + ) instance_2 = Freeclimb::Pause.new( length: 1, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -89,9 +95,11 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::Pause.new( length: 2, + ) instance_2 = Freeclimb::Pause.new( length: 1, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -101,8 +109,9 @@ it 'calculates hash code' do instance = Freeclimb::Pause.new( length: 1, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -110,8 +119,13 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::Pause.new( length: 1, + ) - instance_2 = Freeclimb::Pause.new + instance_2 = Freeclimb::Pause.new( + length: 1, + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -119,6 +133,7 @@ describe 'test method "_deserialize"' do instance = Freeclimb::Pause.new( length: 1, + ) it 'deserializes the data of length' do expect(instance._deserialize("Integer", instance.length)).to be_a_kind_of(Integer) @@ -129,6 +144,7 @@ it 'returns the string representation of the object' do instance = Freeclimb::Pause.new( length: 1, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -138,6 +154,7 @@ it 'returns the object in the form of hash' do instance = Freeclimb::Pause.new( length: 1, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -145,9 +162,11 @@ obj = Object.new() instance_1 = Freeclimb::Pause.new( length: 1, + ) instance_2 = Freeclimb::Pause.new( length: 1, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -156,6 +175,7 @@ describe 'test method "_to_hash"' do instance = Freeclimb::Pause.new( length: 1, + ) it 'returns length in the form of hash' do expect(instance._to_hash(instance.length)).to eq(instance.length) diff --git a/spec/models/percl_command_spec.rb b/spec/models/percl_command_spec.rb index 4bf87e18..fc2dd613 100644 --- a/spec/models/percl_command_spec.rb +++ b/spec/models/percl_command_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -29,21 +29,24 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::PerclCommand.new( - command: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::PerclCommand.new( + command: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::PerclCommand' do - expect{instance = Freeclimb::PerclCommand.new( - command: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::PerclCommand.new( + command: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::PerclCommand.new( - command: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::PerclCommand.new( + command: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -51,6 +54,7 @@ it 'checks if properties are valid' do instance = Freeclimb::PerclCommand.new( command: "TS", + ) expect(instance.valid?).to eq(true) end @@ -70,9 +74,11 @@ obj = Object.new() instance_1 = Freeclimb::PerclCommand.new( command: "TS", + ) instance_2 = Freeclimb::PerclCommand.new( command: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -80,9 +86,11 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::PerclCommand.new( command: "TS", + ) instance_2 = Freeclimb::PerclCommand.new( command: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -92,8 +100,9 @@ it 'calculates hash code' do instance = Freeclimb::PerclCommand.new( command: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -101,8 +110,13 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::PerclCommand.new( command: "TS", + ) - instance_2 = Freeclimb::PerclCommand.new + instance_2 = Freeclimb::PerclCommand.new( + command: "TS", + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -110,6 +124,7 @@ describe 'test method "_deserialize"' do instance = Freeclimb::PerclCommand.new( command: "TS", + ) it 'deserializes the data of command' do expect(instance._deserialize("String", instance.command)).to be_a_kind_of(String) @@ -120,6 +135,7 @@ it 'returns the string representation of the object' do instance = Freeclimb::PerclCommand.new( command: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -129,6 +145,7 @@ it 'returns the object in the form of hash' do instance = Freeclimb::PerclCommand.new( command: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -136,9 +153,11 @@ obj = Object.new() instance_1 = Freeclimb::PerclCommand.new( command: "TS", + ) instance_2 = Freeclimb::PerclCommand.new( command: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -147,6 +166,7 @@ describe 'test method "_to_hash"' do instance = Freeclimb::PerclCommand.new( command: "TS", + ) it 'returns command in the form of hash' do expect(instance._to_hash(instance.command)).to eq(instance.command) diff --git a/spec/models/percl_script_spec.rb b/spec/models/percl_script_spec.rb index 8d9ba129..6e0bc343 100644 --- a/spec/models/percl_script_spec.rb +++ b/spec/models/percl_script_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -36,21 +36,24 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::PerclScript.new( - commands: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::PerclScript.new( + commands: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::PerclScript' do - expect{instance = Freeclimb::PerclScript.new( - commands: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::PerclScript.new( + commands: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::PerclScript.new( - commands: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::PerclScript.new( + commands: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -58,6 +61,7 @@ it 'checks if properties are valid' do instance = Freeclimb::PerclScript.new( commands: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -76,24 +80,24 @@ it 'checks if objects are equal' do obj = Object.new() instance_1 = Freeclimb::PerclScript.new( - commands: Freeclimb::PerclCommand.new(), commands: [], + ) instance_2 = Freeclimb::PerclScript.new( - commands: Freeclimb::PerclCommand.new(), commands: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end it 'checks if objects are not equal' do instance_1 = Freeclimb::PerclScript.new( - commands: Freeclimb::PerclCommand.new(), commands: [], + ) instance_2 = Freeclimb::PerclScript.new( - commands: Freeclimb::PerclCommand.new(), commands: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -103,8 +107,9 @@ it 'calculates hash code' do instance = Freeclimb::PerclScript.new( commands: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -112,8 +117,13 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::PerclScript.new( commands: Array.new(), + ) - instance_2 = Freeclimb::PerclScript.new + instance_2 = Freeclimb::PerclScript.new( + commands: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -121,6 +131,7 @@ describe 'test method "_deserialize"' do instance = Freeclimb::PerclScript.new( commands: Array.new(), + ) it 'deserializes the data of commands' do expect(instance._deserialize("Array", instance.commands)).to be_a_kind_of(Array) @@ -131,6 +142,7 @@ it 'returns the string representation of the object' do instance = Freeclimb::PerclScript.new( commands: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -140,6 +152,7 @@ it 'returns the object in the form of hash' do instance = Freeclimb::PerclScript.new( commands: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -147,9 +160,11 @@ obj = Object.new() instance_1 = Freeclimb::PerclScript.new( commands: Array.new(), + ) instance_2 = Freeclimb::PerclScript.new( commands: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -158,6 +173,7 @@ describe 'test method "_to_hash"' do instance = Freeclimb::PerclScript.new( commands: Array.new(), + ) it 'returns commands in the form of hash' do expect(instance._to_hash(instance.commands)).to eq(instance.commands) diff --git a/spec/models/play_beep_spec.rb b/spec/models/play_beep_spec.rb index 48726088..a3823045 100644 --- a/spec/models/play_beep_spec.rb +++ b/spec/models/play_beep_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/play_early_media_spec.rb b/spec/models/play_early_media_spec.rb index f333a5db..77edda39 100644 --- a/spec/models/play_early_media_spec.rb +++ b/spec/models/play_early_media_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -36,21 +36,24 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::PlayEarlyMedia.new( - file: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::PlayEarlyMedia.new( + file: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::PlayEarlyMedia' do - expect{instance = Freeclimb::PlayEarlyMedia.new( - file: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::PlayEarlyMedia.new( + file: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::PlayEarlyMedia.new( - file: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::PlayEarlyMedia.new( + file: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -58,6 +61,7 @@ it 'checks if properties are valid' do instance = Freeclimb::PlayEarlyMedia.new( file: "TS", + ) expect(instance.valid?).to eq(true) end @@ -77,9 +81,11 @@ obj = Object.new() instance_1 = Freeclimb::PlayEarlyMedia.new( file: "TS", + ) instance_2 = Freeclimb::PlayEarlyMedia.new( file: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -87,9 +93,11 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::PlayEarlyMedia.new( file: "TS", + ) instance_2 = Freeclimb::PlayEarlyMedia.new( file: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -99,8 +107,9 @@ it 'calculates hash code' do instance = Freeclimb::PlayEarlyMedia.new( file: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -108,8 +117,13 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::PlayEarlyMedia.new( file: "TS", + ) - instance_2 = Freeclimb::PlayEarlyMedia.new + instance_2 = Freeclimb::PlayEarlyMedia.new( + file: "TS", + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -117,6 +131,7 @@ describe 'test method "_deserialize"' do instance = Freeclimb::PlayEarlyMedia.new( file: "TS", + ) it 'deserializes the data of file' do expect(instance._deserialize("String", instance.file)).to be_a_kind_of(String) @@ -127,6 +142,7 @@ it 'returns the string representation of the object' do instance = Freeclimb::PlayEarlyMedia.new( file: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -136,6 +152,7 @@ it 'returns the object in the form of hash' do instance = Freeclimb::PlayEarlyMedia.new( file: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -143,9 +160,11 @@ obj = Object.new() instance_1 = Freeclimb::PlayEarlyMedia.new( file: "TS", + ) instance_2 = Freeclimb::PlayEarlyMedia.new( file: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -154,6 +173,7 @@ describe 'test method "_to_hash"' do instance = Freeclimb::PlayEarlyMedia.new( file: "TS", + ) it 'returns file in the form of hash' do expect(instance._to_hash(instance.file)).to eq(instance.file) diff --git a/spec/models/play_spec.rb b/spec/models/play_spec.rb index 8b2588f2..8c0dbf28 100644 --- a/spec/models/play_spec.rb +++ b/spec/models/play_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -54,27 +54,36 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::Play.new( - file: "TS", - loop: 1, - privacy_mode: true, - )}.not_to raise_error() + expect { instance = Freeclimb::Play.new( + file: "TS", + + loop: 1, + + privacy_mode: true, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::Play' do - expect{instance = Freeclimb::Play.new( - file: "TS", - loop: 1, - privacy_mode: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Play.new( + file: "TS", + + loop: 1, + + privacy_mode: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::Play.new( - file: "TS", - loop: 1, - privacy_mode: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Play.new( + file: "TS", + + loop: 1, + + privacy_mode: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -82,8 +91,11 @@ it 'checks if properties are valid' do instance = Freeclimb::Play.new( file: "TS", + loop: 1, + privacy_mode: true, + ) expect(instance.valid?).to eq(true) end @@ -103,13 +115,19 @@ obj = Object.new() instance_1 = Freeclimb::Play.new( file: "TS", + loop: 1, + privacy_mode: true, + ) instance_2 = Freeclimb::Play.new( file: "TS", + loop: 1, + privacy_mode: true, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -117,13 +135,19 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::Play.new( file: "TS", + loop: 2, + privacy_mode: true, + ) instance_2 = Freeclimb::Play.new( file: "ST", + loop: 1, + privacy_mode: false, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -133,10 +157,13 @@ it 'calculates hash code' do instance = Freeclimb::Play.new( file: "TS", + loop: 1, + privacy_mode: true, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -144,10 +171,21 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::Play.new( file: "TS", + loop: 1, + privacy_mode: true, + ) - instance_2 = Freeclimb::Play.new + instance_2 = Freeclimb::Play.new( + file: "TS", + + loop: 1, + + privacy_mode: true, + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -155,8 +193,11 @@ describe 'test method "_deserialize"' do instance = Freeclimb::Play.new( file: "TS", + loop: 1, + privacy_mode: true, + ) it 'deserializes the data of file' do expect(instance._deserialize("String", instance.file)).to be_a_kind_of(String) @@ -173,8 +214,11 @@ it 'returns the string representation of the object' do instance = Freeclimb::Play.new( file: "TS", + loop: 1, + privacy_mode: true, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -184,8 +228,11 @@ it 'returns the object in the form of hash' do instance = Freeclimb::Play.new( file: "TS", + loop: 1, + privacy_mode: true, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -193,13 +240,19 @@ obj = Object.new() instance_1 = Freeclimb::Play.new( file: "TS", + loop: 1, + privacy_mode: true, + ) instance_2 = Freeclimb::Play.new( file: "TS", + loop: 1, + privacy_mode: true, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -208,10 +261,13 @@ describe 'test method "_to_hash"' do instance = Freeclimb::Play.new( file: "TS", + loop: 1, + privacy_mode: true, + ) it 'returns file in the form of hash' do expect(instance._to_hash(instance.file)).to eq(instance.file) diff --git a/spec/models/queue_list_spec.rb b/spec/models/queue_list_spec.rb index 0a5b880c..17320fb6 100644 --- a/spec/models/queue_list_spec.rb +++ b/spec/models/queue_list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,42 +104,66 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::QueueList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - queues: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::QueueList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + queues: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::QueueList' do - expect{instance = Freeclimb::QueueList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - queues: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::QueueList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + queues: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::QueueList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - queues: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::QueueList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + queues: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -147,13 +171,21 @@ it 'checks if properties are valid' do instance = Freeclimb::QueueList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queues: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -173,25 +205,39 @@ obj = Object.new() instance_1 = Freeclimb::QueueList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - queues: Freeclimb::QueueResult.new(), + queues: [], + ) instance_2 = Freeclimb::QueueList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - queues: Freeclimb::QueueResult.new(), + queues: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,25 +245,39 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::QueueList.new( total: 2, + start: 2, + _end: 2, + page: 2, + num_pages: 2, + page_size: 2, + next_page_uri: "TS", - queues: Freeclimb::QueueResult.new(), + queues: [], + ) instance_2 = Freeclimb::QueueList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "ST", - queues: Freeclimb::QueueResult.new(), + queues: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -227,15 +287,23 @@ it 'calculates hash code' do instance = Freeclimb::QueueList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queues: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -243,15 +311,41 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::QueueList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queues: Array.new(), + ) - instance_2 = Freeclimb::QueueList.new + instance_2 = Freeclimb::QueueList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + queues: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -259,13 +353,21 @@ describe 'test method "_deserialize"' do instance = Freeclimb::QueueList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queues: Array.new(), + ) it 'deserializes the data of total' do expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) @@ -297,13 +399,21 @@ it 'returns the string representation of the object' do instance = Freeclimb::QueueList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queues: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -313,13 +423,21 @@ it 'returns the object in the form of hash' do instance = Freeclimb::QueueList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queues: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -327,23 +445,39 @@ obj = Object.new() instance_1 = Freeclimb::QueueList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queues: Array.new(), + ) instance_2 = Freeclimb::QueueList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queues: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -352,20 +486,28 @@ describe 'test method "_to_hash"' do instance = Freeclimb::QueueList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queues: Array.new(), + ) it 'returns total in the form of hash' do expect(instance._to_hash(instance.total)).to eq(instance.total) diff --git a/spec/models/queue_member_list_spec.rb b/spec/models/queue_member_list_spec.rb index 7005e338..9ca1971d 100644 --- a/spec/models/queue_member_list_spec.rb +++ b/spec/models/queue_member_list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,42 +104,66 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::QueueMemberList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - queue_members: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::QueueMemberList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + queue_members: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::QueueMemberList' do - expect{instance = Freeclimb::QueueMemberList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - queue_members: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::QueueMemberList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + queue_members: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::QueueMemberList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - queue_members: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::QueueMemberList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + queue_members: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -147,13 +171,21 @@ it 'checks if properties are valid' do instance = Freeclimb::QueueMemberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queue_members: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -173,25 +205,39 @@ obj = Object.new() instance_1 = Freeclimb::QueueMemberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - queue_members: Freeclimb::QueueMember.new(), + queue_members: [], + ) instance_2 = Freeclimb::QueueMemberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - queue_members: Freeclimb::QueueMember.new(), + queue_members: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,25 +245,39 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::QueueMemberList.new( total: 2, + start: 2, + _end: 2, + page: 2, + num_pages: 2, + page_size: 2, + next_page_uri: "TS", - queue_members: Freeclimb::QueueMember.new(), + queue_members: [], + ) instance_2 = Freeclimb::QueueMemberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "ST", - queue_members: Freeclimb::QueueMember.new(), + queue_members: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -227,15 +287,23 @@ it 'calculates hash code' do instance = Freeclimb::QueueMemberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queue_members: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -243,15 +311,41 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::QueueMemberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queue_members: Array.new(), + ) - instance_2 = Freeclimb::QueueMemberList.new + instance_2 = Freeclimb::QueueMemberList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + queue_members: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -259,13 +353,21 @@ describe 'test method "_deserialize"' do instance = Freeclimb::QueueMemberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queue_members: Array.new(), + ) it 'deserializes the data of total' do expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) @@ -297,13 +399,21 @@ it 'returns the string representation of the object' do instance = Freeclimb::QueueMemberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queue_members: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -313,13 +423,21 @@ it 'returns the object in the form of hash' do instance = Freeclimb::QueueMemberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queue_members: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -327,23 +445,39 @@ obj = Object.new() instance_1 = Freeclimb::QueueMemberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queue_members: Array.new(), + ) instance_2 = Freeclimb::QueueMemberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queue_members: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -352,20 +486,28 @@ describe 'test method "_to_hash"' do instance = Freeclimb::QueueMemberList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + queue_members: Array.new(), + ) it 'returns total in the form of hash' do expect(instance._to_hash(instance.total)).to eq(instance.total) diff --git a/spec/models/queue_member_spec.rb b/spec/models/queue_member_spec.rb index 94e5bb46..fa95fab9 100644 --- a/spec/models/queue_member_spec.rb +++ b/spec/models/queue_member_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -72,33 +72,48 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::QueueMember.new( - uri: "TS", - call_id: "TS", - wait_time: 1, - position: 1, - date_enqueued: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::QueueMember.new( + uri: "TS", + + call_id: "TS", + + wait_time: 1, + + position: 1, + + date_enqueued: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::QueueMember' do - expect{instance = Freeclimb::QueueMember.new( - uri: "TS", - call_id: "TS", - wait_time: 1, - position: 1, - date_enqueued: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::QueueMember.new( + uri: "TS", + + call_id: "TS", + + wait_time: 1, + + position: 1, + + date_enqueued: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::QueueMember.new( - uri: "TS", - call_id: "TS", - wait_time: 1, - position: 1, - date_enqueued: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::QueueMember.new( + uri: "TS", + + call_id: "TS", + + wait_time: 1, + + position: 1, + + date_enqueued: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -106,10 +121,15 @@ it 'checks if properties are valid' do instance = Freeclimb::QueueMember.new( uri: "TS", + call_id: "TS", + wait_time: 1, + position: 1, + date_enqueued: "TS", + ) expect(instance.valid?).to eq(true) end @@ -129,17 +149,27 @@ obj = Object.new() instance_1 = Freeclimb::QueueMember.new( uri: "TS", + call_id: "TS", + wait_time: 1, + position: 1, + date_enqueued: "TS", + ) instance_2 = Freeclimb::QueueMember.new( uri: "TS", + call_id: "TS", + wait_time: 1, + position: 1, + date_enqueued: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -147,17 +177,27 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::QueueMember.new( uri: "TS", + call_id: "TS", + wait_time: 2, + position: 2, + date_enqueued: "TS", + ) instance_2 = Freeclimb::QueueMember.new( uri: "ST", + call_id: "ST", + wait_time: 1, + position: 1, + date_enqueued: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -167,12 +207,17 @@ it 'calculates hash code' do instance = Freeclimb::QueueMember.new( uri: "TS", + call_id: "TS", + wait_time: 1, + position: 1, + date_enqueued: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -180,12 +225,29 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::QueueMember.new( uri: "TS", + call_id: "TS", + wait_time: 1, + position: 1, + date_enqueued: "TS", + ) - instance_2 = Freeclimb::QueueMember.new + instance_2 = Freeclimb::QueueMember.new( + uri: "TS", + + call_id: "TS", + + wait_time: 1, + + position: 1, + + date_enqueued: "TS", + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -193,10 +255,15 @@ describe 'test method "_deserialize"' do instance = Freeclimb::QueueMember.new( uri: "TS", + call_id: "TS", + wait_time: 1, + position: 1, + date_enqueued: "TS", + ) it 'deserializes the data of uri' do expect(instance._deserialize("String", instance.uri)).to be_a_kind_of(String) @@ -219,10 +286,15 @@ it 'returns the string representation of the object' do instance = Freeclimb::QueueMember.new( uri: "TS", + call_id: "TS", + wait_time: 1, + position: 1, + date_enqueued: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -232,10 +304,15 @@ it 'returns the object in the form of hash' do instance = Freeclimb::QueueMember.new( uri: "TS", + call_id: "TS", + wait_time: 1, + position: 1, + date_enqueued: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -243,17 +320,27 @@ obj = Object.new() instance_1 = Freeclimb::QueueMember.new( uri: "TS", + call_id: "TS", + wait_time: 1, + position: 1, + date_enqueued: "TS", + ) instance_2 = Freeclimb::QueueMember.new( uri: "TS", + call_id: "TS", + wait_time: 1, + position: 1, + date_enqueued: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -262,14 +349,19 @@ describe 'test method "_to_hash"' do instance = Freeclimb::QueueMember.new( uri: "TS", + call_id: "TS", + wait_time: 1, + position: 1, + date_enqueued: "TS", + ) it 'returns uri in the form of hash' do expect(instance._to_hash(instance.uri)).to eq(instance.uri) diff --git a/spec/models/queue_request_spec.rb b/spec/models/queue_request_spec.rb index 7a9cc759..b692c1fd 100644 --- a/spec/models/queue_request_spec.rb +++ b/spec/models/queue_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -46,24 +46,30 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::QueueRequest.new( - _alias: "TS", - max_size: 1, - )}.not_to raise_error() + expect { instance = Freeclimb::QueueRequest.new( + _alias: "TS", + + max_size: 1, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::QueueRequest' do - expect{instance = Freeclimb::QueueRequest.new( - _alias: "TS", - max_size: 1, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::QueueRequest.new( + _alias: "TS", + + max_size: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::QueueRequest.new( - _alias: "TS", - max_size: 1, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::QueueRequest.new( + _alias: "TS", + + max_size: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -71,7 +77,9 @@ it 'checks if properties are valid' do instance = Freeclimb::QueueRequest.new( _alias: "TS", + max_size: 1, + ) expect(instance.valid?).to eq(true) end @@ -91,11 +99,15 @@ obj = Object.new() instance_1 = Freeclimb::QueueRequest.new( _alias: "TS", + max_size: 1, + ) instance_2 = Freeclimb::QueueRequest.new( _alias: "TS", + max_size: 1, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -103,11 +115,15 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::QueueRequest.new( _alias: "TS", + max_size: 2, + ) instance_2 = Freeclimb::QueueRequest.new( _alias: "ST", + max_size: 1, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -117,9 +133,11 @@ it 'calculates hash code' do instance = Freeclimb::QueueRequest.new( _alias: "TS", + max_size: 1, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -127,9 +145,17 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::QueueRequest.new( _alias: "TS", + max_size: 1, + + ) + instance_2 = Freeclimb::QueueRequest.new( + _alias: "TS", + + max_size: 1, + ) - instance_2 = Freeclimb::QueueRequest.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -137,7 +163,9 @@ describe 'test method "_deserialize"' do instance = Freeclimb::QueueRequest.new( _alias: "TS", + max_size: 1, + ) it 'deserializes the data of _alias' do expect(instance._deserialize("String", instance._alias)).to be_a_kind_of(String) @@ -151,7 +179,9 @@ it 'returns the string representation of the object' do instance = Freeclimb::QueueRequest.new( _alias: "TS", + max_size: 1, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -161,7 +191,9 @@ it 'returns the object in the form of hash' do instance = Freeclimb::QueueRequest.new( _alias: "TS", + max_size: 1, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -169,11 +201,15 @@ obj = Object.new() instance_1 = Freeclimb::QueueRequest.new( _alias: "TS", + max_size: 1, + ) instance_2 = Freeclimb::QueueRequest.new( _alias: "TS", + max_size: 1, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -182,8 +218,10 @@ describe 'test method "_to_hash"' do instance = Freeclimb::QueueRequest.new( _alias: "TS", + max_size: 1, + ) it 'returns _alias in the form of hash' do expect(instance._to_hash(instance._alias)).to eq(instance._alias) diff --git a/spec/models/queue_result_spec.rb b/spec/models/queue_result_spec.rb index e24a8dcf..11deb520 100644 --- a/spec/models/queue_result_spec.rb +++ b/spec/models/queue_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -125,51 +125,84 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::QueueResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - account_id: "TS", - queue_id: "TS", - _alias: "TS", - max_size: 1, - current_size: 1, - average_queue_removal_time: 1, - subresource_uris: Object.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::QueueResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + queue_id: "TS", + + _alias: "TS", + + max_size: 1, + + current_size: 1, + + average_queue_removal_time: 1, + + subresource_uris: Object.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::QueueResult' do - expect{instance = Freeclimb::QueueResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - account_id: "TS", - queue_id: "TS", - _alias: "TS", - max_size: 1, - current_size: 1, - average_queue_removal_time: 1, - subresource_uris: Object.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::QueueResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + queue_id: "TS", + + _alias: "TS", + + max_size: 1, + + current_size: 1, + + average_queue_removal_time: 1, + + subresource_uris: Object.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::QueueResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - account_id: "TS", - queue_id: "TS", - _alias: "TS", - max_size: 1, - current_size: 1, - average_queue_removal_time: 1, - subresource_uris: Object.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::QueueResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + queue_id: "TS", + + _alias: "TS", + + max_size: 1, + + current_size: 1, + + average_queue_removal_time: 1, + + subresource_uris: Object.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -177,16 +210,27 @@ it 'checks if properties are valid' do instance = Freeclimb::QueueResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + queue_id: "TS", + _alias: "TS", + max_size: 1, + current_size: 1, + average_queue_removal_time: 1, + subresource_uris: Object.new(), + ) expect(instance.valid?).to eq(true) end @@ -206,29 +250,51 @@ obj = Object.new() instance_1 = Freeclimb::QueueResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + queue_id: "TS", + _alias: "TS", + max_size: 1, + current_size: 1, + average_queue_removal_time: 1, + subresource_uris: obj, + ) instance_2 = Freeclimb::QueueResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + queue_id: "TS", + _alias: "TS", + max_size: 1, + current_size: 1, + average_queue_removal_time: 1, + subresource_uris: obj, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -236,29 +302,51 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::QueueResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 2, + account_id: "TS", + queue_id: "TS", + _alias: "TS", + max_size: 2, + current_size: 2, + average_queue_removal_time: 2, + subresource_uris: Object.new(), + ) instance_2 = Freeclimb::QueueResult.new( uri: "ST", + date_created: "ST", + date_updated: "ST", + revision: 1, + account_id: "ST", + queue_id: "ST", + _alias: "ST", + max_size: 1, + current_size: 1, + average_queue_removal_time: 1, + subresource_uris: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -268,18 +356,29 @@ it 'calculates hash code' do instance = Freeclimb::QueueResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + queue_id: "TS", + _alias: "TS", + max_size: 1, + current_size: 1, + average_queue_removal_time: 1, + subresource_uris: Object.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -287,18 +386,53 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::QueueResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + queue_id: "TS", + _alias: "TS", + max_size: 1, + current_size: 1, + average_queue_removal_time: 1, + subresource_uris: Object.new(), + ) - instance_2 = Freeclimb::QueueResult.new + instance_2 = Freeclimb::QueueResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + account_id: "TS", + + queue_id: "TS", + + _alias: "TS", + + max_size: 1, + + current_size: 1, + + average_queue_removal_time: 1, + + subresource_uris: Object.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -306,16 +440,27 @@ describe 'test method "_deserialize"' do instance = Freeclimb::QueueResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + queue_id: "TS", + _alias: "TS", + max_size: 1, + current_size: 1, + average_queue_removal_time: 1, + subresource_uris: Object.new(), + ) it 'deserializes the data of uri' do expect(instance._deserialize("String", instance.uri)).to be_a_kind_of(String) @@ -356,16 +501,27 @@ it 'returns the string representation of the object' do instance = Freeclimb::QueueResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + queue_id: "TS", + _alias: "TS", + max_size: 1, + current_size: 1, + average_queue_removal_time: 1, + subresource_uris: Object.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -375,16 +531,27 @@ it 'returns the object in the form of hash' do instance = Freeclimb::QueueResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + queue_id: "TS", + _alias: "TS", + max_size: 1, + current_size: 1, + average_queue_removal_time: 1, + subresource_uris: Object.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -392,29 +559,51 @@ obj = Object.new() instance_1 = Freeclimb::QueueResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + queue_id: "TS", + _alias: "TS", + max_size: 1, + current_size: 1, + average_queue_removal_time: 1, + subresource_uris: obj, + ) instance_2 = Freeclimb::QueueResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + queue_id: "TS", + _alias: "TS", + max_size: 1, + current_size: 1, + average_queue_removal_time: 1, + subresource_uris: obj, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -423,26 +612,37 @@ describe 'test method "_to_hash"' do instance = Freeclimb::QueueResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + account_id: "TS", + queue_id: "TS", + _alias: "TS", + max_size: 1, + current_size: 1, + average_queue_removal_time: 1, + subresource_uris: Object.new(), + ) it 'returns uri in the form of hash' do expect(instance._to_hash(instance.uri)).to eq(instance.uri) diff --git a/spec/models/queue_result_status_spec.rb b/spec/models/queue_result_status_spec.rb index c8d979ef..1e01c6b0 100644 --- a/spec/models/queue_result_status_spec.rb +++ b/spec/models/queue_result_status_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/queue_wait_webhook_spec.rb b/spec/models/queue_wait_webhook_spec.rb new file mode 100644 index 00000000..26843acb --- /dev/null +++ b/spec/models/queue_wait_webhook_spec.rb @@ -0,0 +1,794 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::QueueWaitWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::QueueWaitWebhook do + let(:instance) { Freeclimb::QueueWaitWebhook.new } + + describe 'test an instance of QueueWaitWebhook' do + it 'should create an instance of QueueWaitWebhook' do + expect(instance).to be_instance_of(Freeclimb::QueueWaitWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of QueueWaitWebhook' do + payload = '{ "requestType": "queueWait" }' + expect(Freeclimb::QueueWaitWebhook.deserialize(payload)).to be_instance_of(Freeclimb::QueueWaitWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_position"' do + it 'should work' do + instance.queue_position = "TEST_STRING" + expect(instance.queue_position).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_time"' do + it 'should work' do + + + instance.queue_time = 1 + expect(instance.queue_time).to eq(1) + + end + end + + describe 'test attribute "current_queue_size"' do + it 'should work' do + + + instance.current_queue_size = 1 + expect(instance.current_queue_size).to eq(1) + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::QueueWaitWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_position: "TS", + + queue_time: 1, + + current_queue_size: 1, + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::QueueWaitWebhook' do + expect { instance = Freeclimb::QueueWaitWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_position: "TS", + + queue_time: 1, + + current_queue_size: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::QueueWaitWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_position: "TS", + + queue_time: 1, + + current_queue_size: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::QueueWaitWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_position: "TS", + + queue_time: 1, + + current_queue_size: 1, + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::QueueWaitWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::QueueWaitWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_position: "TS", + + queue_time: 1, + + current_queue_size: 1, + + ) + instance_2 = Freeclimb::QueueWaitWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_position: "TS", + + queue_time: 1, + + current_queue_size: 1, + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::QueueWaitWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_position: "TS", + + queue_time: 2, + + current_queue_size: 2, + + ) + instance_2 = Freeclimb::QueueWaitWebhook.new( + request_type: "ST", + + account_id: "ST", + + call_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + queue_position: "ST", + + queue_time: 1, + + current_queue_size: 1, + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::QueueWaitWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_position: "TS", + + queue_time: 1, + + current_queue_size: 1, + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::QueueWaitWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_position: "TS", + + queue_time: 1, + + current_queue_size: 1, + + ) + instance_2 = Freeclimb::QueueWaitWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_position: "TS", + + queue_time: 1, + + current_queue_size: 1, + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::QueueWaitWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_position: "TS", + + queue_time: 1, + + current_queue_size: 1, + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_position' do + expect(instance._deserialize("String", instance.queue_position)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_time' do + expect(instance._deserialize("Integer", instance.queue_time)).to be_a_kind_of(Integer) + end + it 'deserializes the data of current_queue_size' do + expect(instance._deserialize("Integer", instance.current_queue_size)).to be_a_kind_of(Integer) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::QueueWaitWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_position: "TS", + + queue_time: 1, + + current_queue_size: 1, + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::QueueWaitWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_position: "TS", + + queue_time: 1, + + current_queue_size: 1, + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::QueueWaitWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_position: "TS", + + queue_time: 1, + + current_queue_size: 1, + + ) + instance_2 = Freeclimb::QueueWaitWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + queue_position: "TS", + + queue_time: 1, + + current_queue_size: 1, + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::QueueWaitWebhook.new( + request_type: "TS", + + + account_id: "TS", + + + call_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + + queue_position: "TS", + + + queue_time: 1, + + + current_queue_size: 1, + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + it 'returns queue_position in the form of hash' do + expect(instance._to_hash(instance.queue_position)).to eq(instance.queue_position) + end + it 'returns queue_time in the form of hash' do + expect(instance._to_hash(instance.queue_time)).to eq(instance.queue_time) + end + it 'returns current_queue_size in the form of hash' do + expect(instance._to_hash(instance.current_queue_size)).to eq(instance.current_queue_size) + end + end + +end diff --git a/spec/models/record_utterance_spec.rb b/spec/models/record_utterance_spec.rb index 1781e508..7a69e644 100644 --- a/spec/models/record_utterance_spec.rb +++ b/spec/models/record_utterance_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -88,39 +88,60 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::RecordUtterance.new( - action_url: "TS", - silence_timeout_ms: 1, - finish_on_key: "TS", - max_length_sec: 1, - play_beep: true, - auto_start: true, - privacy_mode: true, - )}.not_to raise_error() + expect { instance = Freeclimb::RecordUtterance.new( + action_url: "TS", + + silence_timeout_ms: 1, + + finish_on_key: "TS", + + max_length_sec: 1, + + play_beep: true, + + auto_start: true, + + privacy_mode: true, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::RecordUtterance' do - expect{instance = Freeclimb::RecordUtterance.new( - action_url: "TS", - silence_timeout_ms: 1, - finish_on_key: "TS", - max_length_sec: 1, - play_beep: true, - auto_start: true, - privacy_mode: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::RecordUtterance.new( + action_url: "TS", + + silence_timeout_ms: 1, + + finish_on_key: "TS", + + max_length_sec: 1, + + play_beep: true, + + auto_start: true, + + privacy_mode: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::RecordUtterance.new( - action_url: "TS", - silence_timeout_ms: 1, - finish_on_key: "TS", - max_length_sec: 1, - play_beep: true, - auto_start: true, - privacy_mode: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::RecordUtterance.new( + action_url: "TS", + + silence_timeout_ms: 1, + + finish_on_key: "TS", + + max_length_sec: 1, + + play_beep: true, + + auto_start: true, + + privacy_mode: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -128,12 +149,19 @@ it 'checks if properties are valid' do instance = Freeclimb::RecordUtterance.new( action_url: "TS", + silence_timeout_ms: 1, + finish_on_key: "TS", + max_length_sec: 1, + play_beep: true, + auto_start: true, + privacy_mode: true, + ) expect(instance.valid?).to eq(true) end @@ -153,21 +181,35 @@ obj = Object.new() instance_1 = Freeclimb::RecordUtterance.new( action_url: "TS", + silence_timeout_ms: 1, + finish_on_key: "TS", + max_length_sec: 1, + play_beep: true, + auto_start: true, + privacy_mode: true, + ) instance_2 = Freeclimb::RecordUtterance.new( action_url: "TS", + silence_timeout_ms: 1, + finish_on_key: "TS", + max_length_sec: 1, + play_beep: true, + auto_start: true, + privacy_mode: true, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -175,21 +217,35 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::RecordUtterance.new( action_url: "TS", + silence_timeout_ms: 2, + finish_on_key: "TS", + max_length_sec: 2, + play_beep: true, + auto_start: true, + privacy_mode: true, + ) instance_2 = Freeclimb::RecordUtterance.new( action_url: "ST", + silence_timeout_ms: 1, + finish_on_key: "ST", + max_length_sec: 1, + play_beep: false, + auto_start: false, + privacy_mode: false, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -199,14 +255,21 @@ it 'calculates hash code' do instance = Freeclimb::RecordUtterance.new( action_url: "TS", + silence_timeout_ms: 1, + finish_on_key: "TS", + max_length_sec: 1, + play_beep: true, + auto_start: true, + privacy_mode: true, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -214,14 +277,37 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::RecordUtterance.new( action_url: "TS", + + silence_timeout_ms: 1, + + finish_on_key: "TS", + + max_length_sec: 1, + + play_beep: true, + + auto_start: true, + + privacy_mode: true, + + ) + instance_2 = Freeclimb::RecordUtterance.new( + action_url: "TS", + silence_timeout_ms: 1, + finish_on_key: "TS", + max_length_sec: 1, + play_beep: true, + auto_start: true, + privacy_mode: true, + ) - instance_2 = Freeclimb::RecordUtterance.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -229,12 +315,19 @@ describe 'test method "_deserialize"' do instance = Freeclimb::RecordUtterance.new( action_url: "TS", + silence_timeout_ms: 1, + finish_on_key: "TS", + max_length_sec: 1, + play_beep: true, + auto_start: true, + privacy_mode: true, + ) it 'deserializes the data of action_url' do expect(instance._deserialize("String", instance.action_url)).to be_a_kind_of(String) @@ -263,12 +356,19 @@ it 'returns the string representation of the object' do instance = Freeclimb::RecordUtterance.new( action_url: "TS", + silence_timeout_ms: 1, + finish_on_key: "TS", + max_length_sec: 1, + play_beep: true, + auto_start: true, + privacy_mode: true, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -278,12 +378,19 @@ it 'returns the object in the form of hash' do instance = Freeclimb::RecordUtterance.new( action_url: "TS", + silence_timeout_ms: 1, + finish_on_key: "TS", + max_length_sec: 1, + play_beep: true, + auto_start: true, + privacy_mode: true, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -291,21 +398,35 @@ obj = Object.new() instance_1 = Freeclimb::RecordUtterance.new( action_url: "TS", + silence_timeout_ms: 1, + finish_on_key: "TS", + max_length_sec: 1, + play_beep: true, + auto_start: true, + privacy_mode: true, + ) instance_2 = Freeclimb::RecordUtterance.new( action_url: "TS", + silence_timeout_ms: 1, + finish_on_key: "TS", + max_length_sec: 1, + play_beep: true, + auto_start: true, + privacy_mode: true, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -314,18 +435,25 @@ describe 'test method "_to_hash"' do instance = Freeclimb::RecordUtterance.new( action_url: "TS", + silence_timeout_ms: 1, + finish_on_key: "TS", + max_length_sec: 1, + play_beep: true, + auto_start: true, + privacy_mode: true, + ) it 'returns action_url in the form of hash' do expect(instance._to_hash(instance.action_url)).to eq(instance.action_url) diff --git a/spec/models/record_utterance_term_reason_spec.rb b/spec/models/record_utterance_term_reason_spec.rb index c0f89135..46e51e77 100644 --- a/spec/models/record_utterance_term_reason_spec.rb +++ b/spec/models/record_utterance_term_reason_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/record_webhook_spec.rb b/spec/models/record_webhook_spec.rb new file mode 100644 index 00000000..110f2006 --- /dev/null +++ b/spec/models/record_webhook_spec.rb @@ -0,0 +1,1062 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::RecordWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::RecordWebhook do + let(:instance) { Freeclimb::RecordWebhook.new } + + describe 'test an instance of RecordWebhook' do + it 'should create an instance of RecordWebhook' do + expect(instance).to be_instance_of(Freeclimb::RecordWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of RecordWebhook' do + payload = '{ "requestType": "record" }' + expect(Freeclimb::RecordWebhook.deserialize(payload)).to be_instance_of(Freeclimb::RecordWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_id"' do + it 'should work' do + instance.recording_id = "TEST_STRING" + expect(instance.recording_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_url"' do + it 'should work' do + instance.recording_url = "TEST_STRING" + expect(instance.recording_url).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_size"' do + it 'should work' do + instance.recording_size = "TEST_STRING" + expect(instance.recording_size).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_format"' do + it 'should work' do + instance.recording_format = "TEST_STRING" + expect(instance.recording_format).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_duration_sec"' do + it 'should work' do + + + instance.recording_duration_sec = 1 + expect(instance.recording_duration_sec).to eq(1) + + end + end + + + describe 'test attribute "term_reason"' do + it 'assigns value FINISH_KEY' do + instance.term_reason = Freeclimb::RecordUtteranceTermReason::FINISH_KEY + expect(instance.term_reason).to eq(Freeclimb::RecordUtteranceTermReason::FINISH_KEY) + end + it 'assigns value TIMEOUT' do + instance.term_reason = Freeclimb::RecordUtteranceTermReason::TIMEOUT + expect(instance.term_reason).to eq(Freeclimb::RecordUtteranceTermReason::TIMEOUT) + end + it 'assigns value HANGUP' do + instance.term_reason = Freeclimb::RecordUtteranceTermReason::HANGUP + expect(instance.term_reason).to eq(Freeclimb::RecordUtteranceTermReason::HANGUP) + end + it 'assigns value MAX_LENGTH' do + instance.term_reason = Freeclimb::RecordUtteranceTermReason::MAX_LENGTH + expect(instance.term_reason).to eq(Freeclimb::RecordUtteranceTermReason::MAX_LENGTH) + end + end + describe 'test attribute "parent_call_id"' do + it 'should work' do + instance.parent_call_id = "TEST_STRING" + expect(instance.parent_call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "privacy_mode"' do + it 'should work' do + instance.privacy_mode = false + expect(instance.privacy_mode).to eq(false) + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::RecordWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: "TS", + + recording_format: "TS", + + recording_duration_sec: 1, + + + term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + parent_call_id: "TS", + + privacy_mode: true, + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::RecordWebhook' do + expect { instance = Freeclimb::RecordWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: "TS", + + recording_format: "TS", + + recording_duration_sec: 1, + + + term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + parent_call_id: "TS", + + privacy_mode: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::RecordWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: "TS", + + recording_format: "TS", + + recording_duration_sec: 1, + + + term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + parent_call_id: "TS", + + privacy_mode: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::RecordWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: "TS", + + recording_format: "TS", + + recording_duration_sec: 1, + + + term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + parent_call_id: "TS", + + privacy_mode: true, + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::RecordWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::RecordWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: "TS", + + recording_format: "TS", + + recording_duration_sec: 1, + + + term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + parent_call_id: "TS", + + privacy_mode: true, + + ) + instance_2 = Freeclimb::RecordWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: "TS", + + recording_format: "TS", + + recording_duration_sec: 1, + + + term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + parent_call_id: "TS", + + privacy_mode: true, + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::RecordWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: "TS", + + recording_format: "TS", + + recording_duration_sec: 2, + + + term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + parent_call_id: "TS", + + privacy_mode: true, + + ) + instance_2 = Freeclimb::RecordWebhook.new( + request_type: "ST", + + account_id: "ST", + + call_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + recording_id: "ST", + + recording_url: "ST", + + recording_size: "ST", + + recording_format: "ST", + + recording_duration_sec: 1, + + + term_reason: nil, + + parent_call_id: "ST", + + privacy_mode: false, + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::RecordWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: "TS", + + recording_format: "TS", + + recording_duration_sec: 1, + + + term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + parent_call_id: "TS", + + privacy_mode: true, + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::RecordWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: "TS", + + recording_format: "TS", + + recording_duration_sec: 1, + + + term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + parent_call_id: "TS", + + privacy_mode: true, + + ) + instance_2 = Freeclimb::RecordWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: "TS", + + recording_format: "TS", + + recording_duration_sec: 1, + + + term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + parent_call_id: "TS", + + privacy_mode: true, + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::RecordWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: "TS", + + recording_format: "TS", + + recording_duration_sec: 1, + + + term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + parent_call_id: "TS", + + privacy_mode: true, + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_id' do + expect(instance._deserialize("String", instance.recording_id)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_url' do + expect(instance._deserialize("String", instance.recording_url)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_size' do + expect(instance._deserialize("String", instance.recording_size)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_format' do + expect(instance._deserialize("String", instance.recording_format)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_duration_sec' do + expect(instance._deserialize("Integer", instance.recording_duration_sec)).to be_a_kind_of(Integer) + end + it 'deserializes the data of parent_call_id' do + expect(instance._deserialize("String", instance.parent_call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of privacy_mode' do + expect(instance._deserialize("Boolean", instance.privacy_mode)).to be_a_kind_of(TrueClass) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::RecordWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: "TS", + + recording_format: "TS", + + recording_duration_sec: 1, + + + term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + parent_call_id: "TS", + + privacy_mode: true, + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::RecordWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: "TS", + + recording_format: "TS", + + recording_duration_sec: 1, + + + term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + parent_call_id: "TS", + + privacy_mode: true, + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::RecordWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: "TS", + + recording_format: "TS", + + recording_duration_sec: 1, + + + term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + parent_call_id: "TS", + + privacy_mode: true, + + ) + instance_2 = Freeclimb::RecordWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: "TS", + + recording_format: "TS", + + recording_duration_sec: 1, + + + term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + parent_call_id: "TS", + + privacy_mode: true, + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::RecordWebhook.new( + request_type: "TS", + + + account_id: "TS", + + + call_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + + recording_id: "TS", + + + recording_url: "TS", + + + recording_size: "TS", + + + recording_format: "TS", + + + recording_duration_sec: 1, + + + + term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + + parent_call_id: "TS", + + + privacy_mode: true, + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + it 'returns recording_id in the form of hash' do + expect(instance._to_hash(instance.recording_id)).to eq(instance.recording_id) + end + it 'returns recording_url in the form of hash' do + expect(instance._to_hash(instance.recording_url)).to eq(instance.recording_url) + end + it 'returns recording_size in the form of hash' do + expect(instance._to_hash(instance.recording_size)).to eq(instance.recording_size) + end + it 'returns recording_format in the form of hash' do + expect(instance._to_hash(instance.recording_format)).to eq(instance.recording_format) + end + it 'returns recording_duration_sec in the form of hash' do + expect(instance._to_hash(instance.recording_duration_sec)).to eq(instance.recording_duration_sec) + end + it 'returns term_reason in the form of hash' do + expect(instance._to_hash(instance.term_reason)).to eq(instance.term_reason) + end + it 'returns parent_call_id in the form of hash' do + expect(instance._to_hash(instance.parent_call_id)).to eq(instance.parent_call_id) + end + it 'returns privacy_mode in the form of hash' do + expect(instance._to_hash(instance.privacy_mode)).to eq(instance.privacy_mode) + end + end + +end diff --git a/spec/models/recording_list_spec.rb b/spec/models/recording_list_spec.rb index 1ae483d6..2d01793f 100644 --- a/spec/models/recording_list_spec.rb +++ b/spec/models/recording_list_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,42 +104,66 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::RecordingList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - recordings: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::RecordingList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + recordings: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::RecordingList' do - expect{instance = Freeclimb::RecordingList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - recordings: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::RecordingList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + recordings: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::RecordingList.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - recordings: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::RecordingList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + recordings: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -147,13 +171,21 @@ it 'checks if properties are valid' do instance = Freeclimb::RecordingList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + recordings: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -173,25 +205,39 @@ obj = Object.new() instance_1 = Freeclimb::RecordingList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - recordings: Freeclimb::RecordingResult.new(), + recordings: [], + ) instance_2 = Freeclimb::RecordingList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - recordings: Freeclimb::RecordingResult.new(), + recordings: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,25 +245,39 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::RecordingList.new( total: 2, + start: 2, + _end: 2, + page: 2, + num_pages: 2, + page_size: 2, + next_page_uri: "TS", - recordings: Freeclimb::RecordingResult.new(), + recordings: [], + ) instance_2 = Freeclimb::RecordingList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "ST", - recordings: Freeclimb::RecordingResult.new(), + recordings: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -227,15 +287,23 @@ it 'calculates hash code' do instance = Freeclimb::RecordingList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + recordings: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -243,15 +311,41 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::RecordingList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + recordings: Array.new(), + ) - instance_2 = Freeclimb::RecordingList.new + instance_2 = Freeclimb::RecordingList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + recordings: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -259,13 +353,21 @@ describe 'test method "_deserialize"' do instance = Freeclimb::RecordingList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + recordings: Array.new(), + ) it 'deserializes the data of total' do expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) @@ -297,13 +399,21 @@ it 'returns the string representation of the object' do instance = Freeclimb::RecordingList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + recordings: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -313,13 +423,21 @@ it 'returns the object in the form of hash' do instance = Freeclimb::RecordingList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + recordings: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -327,23 +445,39 @@ obj = Object.new() instance_1 = Freeclimb::RecordingList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + recordings: Array.new(), + ) instance_2 = Freeclimb::RecordingList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + recordings: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -352,20 +486,28 @@ describe 'test method "_to_hash"' do instance = Freeclimb::RecordingList.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + recordings: Array.new(), + ) it 'returns total in the form of hash' do expect(instance._to_hash(instance.total)).to eq(instance.total) diff --git a/spec/models/recording_result_spec.rb b/spec/models/recording_result_spec.rb index f96fc650..eb984d6e 100644 --- a/spec/models/recording_result_spec.rb +++ b/spec/models/recording_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,45 +104,72 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::RecordingResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - recording_id: "TS", - account_id: "TS", - call_id: "TS", - duration_sec: 1, - conference_id: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::RecordingResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + recording_id: "TS", + + account_id: "TS", + + call_id: "TS", + + duration_sec: 1, + + conference_id: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::RecordingResult' do - expect{instance = Freeclimb::RecordingResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - recording_id: "TS", - account_id: "TS", - call_id: "TS", - duration_sec: 1, - conference_id: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::RecordingResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + recording_id: "TS", + + account_id: "TS", + + call_id: "TS", + + duration_sec: 1, + + conference_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::RecordingResult.new( - uri: "TS", - date_created: "TS", - date_updated: "TS", - revision: 1, - recording_id: "TS", - account_id: "TS", - call_id: "TS", - duration_sec: 1, - conference_id: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::RecordingResult.new( + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + recording_id: "TS", + + account_id: "TS", + + call_id: "TS", + + duration_sec: 1, + + conference_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -150,14 +177,23 @@ it 'checks if properties are valid' do instance = Freeclimb::RecordingResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + recording_id: "TS", + account_id: "TS", + call_id: "TS", + duration_sec: 1, + conference_id: "TS", + ) expect(instance.valid?).to eq(true) end @@ -177,25 +213,43 @@ obj = Object.new() instance_1 = Freeclimb::RecordingResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + recording_id: "TS", + account_id: "TS", + call_id: "TS", + duration_sec: 1, + conference_id: "TS", + ) instance_2 = Freeclimb::RecordingResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + recording_id: "TS", + account_id: "TS", + call_id: "TS", + duration_sec: 1, + conference_id: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -203,25 +257,43 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::RecordingResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 2, + recording_id: "TS", + account_id: "TS", + call_id: "TS", + duration_sec: 2, + conference_id: "TS", + ) instance_2 = Freeclimb::RecordingResult.new( uri: "ST", + date_created: "ST", + date_updated: "ST", + revision: 1, + recording_id: "ST", + account_id: "ST", + call_id: "ST", + duration_sec: 1, + conference_id: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -231,16 +303,25 @@ it 'calculates hash code' do instance = Freeclimb::RecordingResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + recording_id: "TS", + account_id: "TS", + call_id: "TS", + duration_sec: 1, + conference_id: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -248,16 +329,45 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::RecordingResult.new( uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + recording_id: "TS", + + account_id: "TS", + + call_id: "TS", + + duration_sec: 1, + + conference_id: "TS", + + ) + instance_2 = Freeclimb::RecordingResult.new( + uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + recording_id: "TS", + account_id: "TS", + call_id: "TS", + duration_sec: 1, + conference_id: "TS", + ) - instance_2 = Freeclimb::RecordingResult.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -265,14 +375,23 @@ describe 'test method "_deserialize"' do instance = Freeclimb::RecordingResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + recording_id: "TS", + account_id: "TS", + call_id: "TS", + duration_sec: 1, + conference_id: "TS", + ) it 'deserializes the data of uri' do expect(instance._deserialize("String", instance.uri)).to be_a_kind_of(String) @@ -307,14 +426,23 @@ it 'returns the string representation of the object' do instance = Freeclimb::RecordingResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + recording_id: "TS", + account_id: "TS", + call_id: "TS", + duration_sec: 1, + conference_id: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -324,14 +452,23 @@ it 'returns the object in the form of hash' do instance = Freeclimb::RecordingResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + recording_id: "TS", + account_id: "TS", + call_id: "TS", + duration_sec: 1, + conference_id: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -339,25 +476,43 @@ obj = Object.new() instance_1 = Freeclimb::RecordingResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + recording_id: "TS", + account_id: "TS", + call_id: "TS", + duration_sec: 1, + conference_id: "TS", + ) instance_2 = Freeclimb::RecordingResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + recording_id: "TS", + account_id: "TS", + call_id: "TS", + duration_sec: 1, + conference_id: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -366,22 +521,31 @@ describe 'test method "_to_hash"' do instance = Freeclimb::RecordingResult.new( uri: "TS", + date_created: "TS", + date_updated: "TS", + revision: 1, + recording_id: "TS", + account_id: "TS", + call_id: "TS", + duration_sec: 1, + conference_id: "TS", + ) it 'returns uri in the form of hash' do expect(instance._to_hash(instance.uri)).to eq(instance.uri) diff --git a/spec/models/redirect_spec.rb b/spec/models/redirect_spec.rb index cabf5bca..7c813dbf 100644 --- a/spec/models/redirect_spec.rb +++ b/spec/models/redirect_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -36,21 +36,24 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::Redirect.new( - action_url: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::Redirect.new( + action_url: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::Redirect' do - expect{instance = Freeclimb::Redirect.new( - action_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Redirect.new( + action_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::Redirect.new( - action_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Redirect.new( + action_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -58,6 +61,7 @@ it 'checks if properties are valid' do instance = Freeclimb::Redirect.new( action_url: "TS", + ) expect(instance.valid?).to eq(true) end @@ -77,9 +81,11 @@ obj = Object.new() instance_1 = Freeclimb::Redirect.new( action_url: "TS", + ) instance_2 = Freeclimb::Redirect.new( action_url: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -87,9 +93,11 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::Redirect.new( action_url: "TS", + ) instance_2 = Freeclimb::Redirect.new( action_url: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -99,8 +107,9 @@ it 'calculates hash code' do instance = Freeclimb::Redirect.new( action_url: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -108,8 +117,13 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::Redirect.new( action_url: "TS", + ) - instance_2 = Freeclimb::Redirect.new + instance_2 = Freeclimb::Redirect.new( + action_url: "TS", + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -117,6 +131,7 @@ describe 'test method "_deserialize"' do instance = Freeclimb::Redirect.new( action_url: "TS", + ) it 'deserializes the data of action_url' do expect(instance._deserialize("String", instance.action_url)).to be_a_kind_of(String) @@ -127,6 +142,7 @@ it 'returns the string representation of the object' do instance = Freeclimb::Redirect.new( action_url: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -136,6 +152,7 @@ it 'returns the object in the form of hash' do instance = Freeclimb::Redirect.new( action_url: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -143,9 +160,11 @@ obj = Object.new() instance_1 = Freeclimb::Redirect.new( action_url: "TS", + ) instance_2 = Freeclimb::Redirect.new( action_url: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -154,6 +173,7 @@ describe 'test method "_to_hash"' do instance = Freeclimb::Redirect.new( action_url: "TS", + ) it 'returns action_url in the form of hash' do expect(instance._to_hash(instance.action_url)).to eq(instance.action_url) diff --git a/spec/models/redirect_webhook_spec.rb b/spec/models/redirect_webhook_spec.rb new file mode 100644 index 00000000..a06b94a0 --- /dev/null +++ b/spec/models/redirect_webhook_spec.rb @@ -0,0 +1,692 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::RedirectWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::RedirectWebhook do + let(:instance) { Freeclimb::RedirectWebhook.new } + + describe 'test an instance of RedirectWebhook' do + it 'should create an instance of RedirectWebhook' do + expect(instance).to be_instance_of(Freeclimb::RedirectWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of RedirectWebhook' do + payload = '{ "requestType": "redirect" }' + expect(Freeclimb::RedirectWebhook.deserialize(payload)).to be_instance_of(Freeclimb::RedirectWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "parent_call_id"' do + it 'should work' do + instance.parent_call_id = "TEST_STRING" + expect(instance.parent_call_id).to eq("TEST_STRING") + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::RedirectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::RedirectWebhook' do + expect { instance = Freeclimb::RedirectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::RedirectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::RedirectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::RedirectWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::RedirectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::RedirectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::RedirectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::RedirectWebhook.new( + request_type: "ST", + + account_id: "ST", + + call_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + parent_call_id: "ST", + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::RedirectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::RedirectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::RedirectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::RedirectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + it 'deserializes the data of parent_call_id' do + expect(instance._deserialize("String", instance.parent_call_id)).to be_a_kind_of(String) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::RedirectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::RedirectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::RedirectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + instance_2 = Freeclimb::RedirectWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + parent_call_id: "TS", + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::RedirectWebhook.new( + request_type: "TS", + + + account_id: "TS", + + + call_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + + parent_call_id: "TS", + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + it 'returns parent_call_id in the form of hash' do + expect(instance._to_hash(instance.parent_call_id)).to eq(instance.parent_call_id) + end + end + +end diff --git a/spec/models/reject_spec.rb b/spec/models/reject_spec.rb index 5f9b8932..3999a7b5 100644 --- a/spec/models/reject_spec.rb +++ b/spec/models/reject_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -36,21 +36,24 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::Reject.new( - reason: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::Reject.new( + reason: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::Reject' do - expect{instance = Freeclimb::Reject.new( - reason: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Reject.new( + reason: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::Reject.new( - reason: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Reject.new( + reason: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -58,6 +61,7 @@ it 'checks if properties are valid' do instance = Freeclimb::Reject.new( reason: "TS", + ) expect(instance.valid?).to eq(true) end @@ -77,9 +81,11 @@ obj = Object.new() instance_1 = Freeclimb::Reject.new( reason: "TS", + ) instance_2 = Freeclimb::Reject.new( reason: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -87,9 +93,11 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::Reject.new( reason: "TS", + ) instance_2 = Freeclimb::Reject.new( reason: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -99,8 +107,9 @@ it 'calculates hash code' do instance = Freeclimb::Reject.new( reason: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -108,8 +117,13 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::Reject.new( reason: "TS", + ) - instance_2 = Freeclimb::Reject.new + instance_2 = Freeclimb::Reject.new( + reason: "TS", + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -117,6 +131,7 @@ describe 'test method "_deserialize"' do instance = Freeclimb::Reject.new( reason: "TS", + ) it 'deserializes the data of reason' do expect(instance._deserialize("String", instance.reason)).to be_a_kind_of(String) @@ -127,6 +142,7 @@ it 'returns the string representation of the object' do instance = Freeclimb::Reject.new( reason: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -136,6 +152,7 @@ it 'returns the object in the form of hash' do instance = Freeclimb::Reject.new( reason: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -143,9 +160,11 @@ obj = Object.new() instance_1 = Freeclimb::Reject.new( reason: "TS", + ) instance_2 = Freeclimb::Reject.new( reason: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -154,6 +173,7 @@ describe 'test method "_to_hash"' do instance = Freeclimb::Reject.new( reason: "TS", + ) it 'returns reason in the form of hash' do expect(instance._to_hash(instance.reason)).to eq(instance.reason) diff --git a/spec/models/remove_from_conference_spec.rb b/spec/models/remove_from_conference_spec.rb index cb1b0af4..af0c4c9b 100644 --- a/spec/models/remove_from_conference_spec.rb +++ b/spec/models/remove_from_conference_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/remove_from_queue_notification_webhook_spec.rb b/spec/models/remove_from_queue_notification_webhook_spec.rb new file mode 100644 index 00000000..ad4134f4 --- /dev/null +++ b/spec/models/remove_from_queue_notification_webhook_spec.rb @@ -0,0 +1,768 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::RemoveFromQueueNotificationWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::RemoveFromQueueNotificationWebhook do + let(:instance) { Freeclimb::RemoveFromQueueNotificationWebhook.new } + + describe 'test an instance of RemoveFromQueueNotificationWebhook' do + it 'should create an instance of RemoveFromQueueNotificationWebhook' do + expect(instance).to be_instance_of(Freeclimb::RemoveFromQueueNotificationWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of RemoveFromQueueNotificationWebhook' do + payload = '{ "requestType": "removeFromQueueNotification" }' + expect(Freeclimb::RemoveFromQueueNotificationWebhook.deserialize(payload)).to be_instance_of(Freeclimb::RemoveFromQueueNotificationWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "call_status"' do + it 'assigns value QUEUED' do + instance.call_status = Freeclimb::CallStatus::QUEUED + expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + end + it 'assigns value RINGING' do + instance.call_status = Freeclimb::CallStatus::RINGING + expect(instance.call_status).to eq(Freeclimb::CallStatus::RINGING) + end + it 'assigns value IN_PROGRESS' do + instance.call_status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.call_status).to eq(Freeclimb::CallStatus::IN_PROGRESS) + end + it 'assigns value CANCELED' do + instance.call_status = Freeclimb::CallStatus::CANCELED + expect(instance.call_status).to eq(Freeclimb::CallStatus::CANCELED) + end + it 'assigns value COMPLETED' do + instance.call_status = Freeclimb::CallStatus::COMPLETED + expect(instance.call_status).to eq(Freeclimb::CallStatus::COMPLETED) + end + it 'assigns value FAILED' do + instance.call_status = Freeclimb::CallStatus::FAILED + expect(instance.call_status).to eq(Freeclimb::CallStatus::FAILED) + end + it 'assigns value BUSY' do + instance.call_status = Freeclimb::CallStatus::BUSY + expect(instance.call_status).to eq(Freeclimb::CallStatus::BUSY) + end + it 'assigns value NO_ANSWER' do + instance.call_status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.call_status).to eq(Freeclimb::CallStatus::NO_ANSWER) + end + end + + describe 'test attribute "direction"' do + it 'assigns value INBOUND' do + instance.direction = Freeclimb::CallDirection::INBOUND + expect(instance.direction).to eq(Freeclimb::CallDirection::INBOUND) + end + it 'assigns value OUTBOUND_API' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_API + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_API) + end + it 'assigns value OUTBOUND_DIAL' do + instance.direction = Freeclimb::CallDirection::OUTBOUND_DIAL + expect(instance.direction).to eq(Freeclimb::CallDirection::OUTBOUND_DIAL) + end + end + describe 'test attribute "conference_id"' do + it 'should work' do + instance.conference_id = "TEST_STRING" + expect(instance.conference_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "queue_id"' do + it 'should work' do + instance.queue_id = "TEST_STRING" + expect(instance.queue_id).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "queue_result"' do + it 'assigns value QUEUE_FULL' do + instance.queue_result = Freeclimb::QueueResultStatus::QUEUE_FULL + expect(instance.queue_result).to eq(Freeclimb::QueueResultStatus::QUEUE_FULL) + end + it 'assigns value DEQUEUED' do + instance.queue_result = Freeclimb::QueueResultStatus::DEQUEUED + expect(instance.queue_result).to eq(Freeclimb::QueueResultStatus::DEQUEUED) + end + it 'assigns value HANGUP' do + instance.queue_result = Freeclimb::QueueResultStatus::HANGUP + expect(instance.queue_result).to eq(Freeclimb::QueueResultStatus::HANGUP) + end + it 'assigns value SYSTEM_ERROR' do + instance.queue_result = Freeclimb::QueueResultStatus::SYSTEM_ERROR + expect(instance.queue_result).to eq(Freeclimb::QueueResultStatus::SYSTEM_ERROR) + end + end + describe 'test attribute "queue_time"' do + it 'should work' do + + + instance.queue_time = 1 + expect(instance.queue_time).to eq(1) + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + queue_result: Freeclimb::QueueResultStatus::QUEUE_FULL, + + queue_time: 1, + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::RemoveFromQueueNotificationWebhook' do + expect { instance = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + queue_result: Freeclimb::QueueResultStatus::QUEUE_FULL, + + queue_time: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + queue_result: Freeclimb::QueueResultStatus::QUEUE_FULL, + + queue_time: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + queue_result: Freeclimb::QueueResultStatus::QUEUE_FULL, + + queue_time: 1, + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::RemoveFromQueueNotificationWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + queue_result: Freeclimb::QueueResultStatus::QUEUE_FULL, + + queue_time: 1, + + ) + instance_2 = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + queue_result: Freeclimb::QueueResultStatus::QUEUE_FULL, + + queue_time: 1, + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + queue_result: Freeclimb::QueueResultStatus::QUEUE_FULL, + + queue_time: 2, + + ) + instance_2 = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "ST", + + account_id: "ST", + + call_id: "ST", + + from: "ST", + + to: "ST", + + + call_status: nil, + + + direction: nil, + + conference_id: "ST", + + queue_id: "ST", + + + queue_result: nil, + + queue_time: 1, + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + queue_result: Freeclimb::QueueResultStatus::QUEUE_FULL, + + queue_time: 1, + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + queue_result: Freeclimb::QueueResultStatus::QUEUE_FULL, + + queue_time: 1, + + ) + instance_2 = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + queue_result: Freeclimb::QueueResultStatus::QUEUE_FULL, + + queue_time: 1, + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + queue_result: Freeclimb::QueueResultStatus::QUEUE_FULL, + + queue_time: 1, + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of conference_id' do + expect(instance._deserialize("String", instance.conference_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_id' do + expect(instance._deserialize("String", instance.queue_id)).to be_a_kind_of(String) + end + it 'deserializes the data of queue_time' do + expect(instance._deserialize("Integer", instance.queue_time)).to be_a_kind_of(Integer) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + queue_result: Freeclimb::QueueResultStatus::QUEUE_FULL, + + queue_time: 1, + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + queue_result: Freeclimb::QueueResultStatus::QUEUE_FULL, + + queue_time: 1, + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + queue_result: Freeclimb::QueueResultStatus::QUEUE_FULL, + + queue_time: 1, + + ) + instance_2 = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + + call_status: Freeclimb::CallStatus::QUEUED, + + + direction: Freeclimb::CallDirection::INBOUND, + + conference_id: "TS", + + queue_id: "TS", + + + queue_result: Freeclimb::QueueResultStatus::QUEUE_FULL, + + queue_time: 1, + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::RemoveFromQueueNotificationWebhook.new( + request_type: "TS", + + + account_id: "TS", + + + call_id: "TS", + + + from: "TS", + + + to: "TS", + + + + call_status: Freeclimb::CallStatus::QUEUED, + + + + direction: Freeclimb::CallDirection::INBOUND, + + + conference_id: "TS", + + + queue_id: "TS", + + + + queue_result: Freeclimb::QueueResultStatus::QUEUE_FULL, + + + queue_time: 1, + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns call_status in the form of hash' do + expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + end + it 'returns direction in the form of hash' do + expect(instance._to_hash(instance.direction)).to eq(instance.direction) + end + it 'returns conference_id in the form of hash' do + expect(instance._to_hash(instance.conference_id)).to eq(instance.conference_id) + end + it 'returns queue_id in the form of hash' do + expect(instance._to_hash(instance.queue_id)).to eq(instance.queue_id) + end + it 'returns queue_result in the form of hash' do + expect(instance._to_hash(instance.queue_result)).to eq(instance.queue_result) + end + it 'returns queue_time in the form of hash' do + expect(instance._to_hash(instance.queue_time)).to eq(instance.queue_time) + end + end + +end diff --git a/spec/models/request_type_spec.rb b/spec/models/request_type_spec.rb index dbd842c3..a0b21f9c 100644 --- a/spec/models/request_type_spec.rb +++ b/spec/models/request_type_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/say_spec.rb b/spec/models/say_spec.rb index b61ec4ed..e6305e35 100644 --- a/spec/models/say_spec.rb +++ b/spec/models/say_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -62,30 +62,42 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::Say.new( - text: "TS", - language: "TS", - loop: 1, - privacy_mode: true, - )}.not_to raise_error() + expect { instance = Freeclimb::Say.new( + text: "TS", + + language: "TS", + + loop: 1, + + privacy_mode: true, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::Say' do - expect{instance = Freeclimb::Say.new( - text: "TS", - language: "TS", - loop: 1, - privacy_mode: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Say.new( + text: "TS", + + language: "TS", + + loop: 1, + + privacy_mode: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::Say.new( - text: "TS", - language: "TS", - loop: 1, - privacy_mode: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Say.new( + text: "TS", + + language: "TS", + + loop: 1, + + privacy_mode: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -93,9 +105,13 @@ it 'checks if properties are valid' do instance = Freeclimb::Say.new( text: "TS", + language: "TS", + loop: 1, + privacy_mode: true, + ) expect(instance.valid?).to eq(true) end @@ -115,15 +131,23 @@ obj = Object.new() instance_1 = Freeclimb::Say.new( text: "TS", + language: "TS", + loop: 1, + privacy_mode: true, + ) instance_2 = Freeclimb::Say.new( text: "TS", + language: "TS", + loop: 1, + privacy_mode: true, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -131,15 +155,23 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::Say.new( text: "TS", + language: "TS", + loop: 2, + privacy_mode: true, + ) instance_2 = Freeclimb::Say.new( text: "ST", + language: "ST", + loop: 1, + privacy_mode: false, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -149,11 +181,15 @@ it 'calculates hash code' do instance = Freeclimb::Say.new( text: "TS", + language: "TS", + loop: 1, + privacy_mode: true, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -161,11 +197,25 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::Say.new( text: "TS", + + language: "TS", + + loop: 1, + + privacy_mode: true, + + ) + instance_2 = Freeclimb::Say.new( + text: "TS", + language: "TS", + loop: 1, + privacy_mode: true, + ) - instance_2 = Freeclimb::Say.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -173,9 +223,13 @@ describe 'test method "_deserialize"' do instance = Freeclimb::Say.new( text: "TS", + language: "TS", + loop: 1, + privacy_mode: true, + ) it 'deserializes the data of text' do expect(instance._deserialize("String", instance.text)).to be_a_kind_of(String) @@ -195,9 +249,13 @@ it 'returns the string representation of the object' do instance = Freeclimb::Say.new( text: "TS", + language: "TS", + loop: 1, + privacy_mode: true, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -207,9 +265,13 @@ it 'returns the object in the form of hash' do instance = Freeclimb::Say.new( text: "TS", + language: "TS", + loop: 1, + privacy_mode: true, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -217,15 +279,23 @@ obj = Object.new() instance_1 = Freeclimb::Say.new( text: "TS", + language: "TS", + loop: 1, + privacy_mode: true, + ) instance_2 = Freeclimb::Say.new( text: "TS", + language: "TS", + loop: 1, + privacy_mode: true, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -234,12 +304,16 @@ describe 'test method "_to_hash"' do instance = Freeclimb::Say.new( text: "TS", + language: "TS", + loop: 1, + privacy_mode: true, + ) it 'returns text in the form of hash' do expect(instance._to_hash(instance.text)).to eq(instance.text) diff --git a/spec/models/send_digits_spec.rb b/spec/models/send_digits_spec.rb index a52587bf..87cd3322 100644 --- a/spec/models/send_digits_spec.rb +++ b/spec/models/send_digits_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -54,27 +54,36 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::SendDigits.new( - digits: "TS", - pause_ms: 1, - privacy_mode: true, - )}.not_to raise_error() + expect { instance = Freeclimb::SendDigits.new( + digits: "TS", + + pause_ms: 1, + + privacy_mode: true, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::SendDigits' do - expect{instance = Freeclimb::SendDigits.new( - digits: "TS", - pause_ms: 1, - privacy_mode: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SendDigits.new( + digits: "TS", + + pause_ms: 1, + + privacy_mode: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::SendDigits.new( - digits: "TS", - pause_ms: 1, - privacy_mode: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SendDigits.new( + digits: "TS", + + pause_ms: 1, + + privacy_mode: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -82,8 +91,11 @@ it 'checks if properties are valid' do instance = Freeclimb::SendDigits.new( digits: "TS", + pause_ms: 1, + privacy_mode: true, + ) expect(instance.valid?).to eq(true) end @@ -103,13 +115,19 @@ obj = Object.new() instance_1 = Freeclimb::SendDigits.new( digits: "TS", + pause_ms: 1, + privacy_mode: true, + ) instance_2 = Freeclimb::SendDigits.new( digits: "TS", + pause_ms: 1, + privacy_mode: true, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -117,13 +135,19 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::SendDigits.new( digits: "TS", + pause_ms: 2, + privacy_mode: true, + ) instance_2 = Freeclimb::SendDigits.new( digits: "ST", + pause_ms: 1, + privacy_mode: false, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -133,10 +157,13 @@ it 'calculates hash code' do instance = Freeclimb::SendDigits.new( digits: "TS", + pause_ms: 1, + privacy_mode: true, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -144,10 +171,21 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::SendDigits.new( digits: "TS", + pause_ms: 1, + privacy_mode: true, + ) - instance_2 = Freeclimb::SendDigits.new + instance_2 = Freeclimb::SendDigits.new( + digits: "TS", + + pause_ms: 1, + + privacy_mode: true, + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -155,8 +193,11 @@ describe 'test method "_deserialize"' do instance = Freeclimb::SendDigits.new( digits: "TS", + pause_ms: 1, + privacy_mode: true, + ) it 'deserializes the data of digits' do expect(instance._deserialize("String", instance.digits)).to be_a_kind_of(String) @@ -173,8 +214,11 @@ it 'returns the string representation of the object' do instance = Freeclimb::SendDigits.new( digits: "TS", + pause_ms: 1, + privacy_mode: true, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -184,8 +228,11 @@ it 'returns the object in the form of hash' do instance = Freeclimb::SendDigits.new( digits: "TS", + pause_ms: 1, + privacy_mode: true, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -193,13 +240,19 @@ obj = Object.new() instance_1 = Freeclimb::SendDigits.new( digits: "TS", + pause_ms: 1, + privacy_mode: true, + ) instance_2 = Freeclimb::SendDigits.new( digits: "TS", + pause_ms: 1, + privacy_mode: true, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -208,10 +261,13 @@ describe 'test method "_to_hash"' do instance = Freeclimb::SendDigits.new( digits: "TS", + pause_ms: 1, + privacy_mode: true, + ) it 'returns digits in the form of hash' do expect(instance._to_hash(instance.digits)).to eq(instance.digits) diff --git a/spec/models/set_dtmf_pass_through_spec.rb b/spec/models/set_dtmf_pass_through_spec.rb index 77807c16..b3f6240f 100644 --- a/spec/models/set_dtmf_pass_through_spec.rb +++ b/spec/models/set_dtmf_pass_through_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -36,21 +36,24 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::SetDTMFPassThrough.new( - dtmf_pass_through: true, - )}.not_to raise_error() + expect { instance = Freeclimb::SetDTMFPassThrough.new( + dtmf_pass_through: true, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::SetDTMFPassThrough' do - expect{instance = Freeclimb::SetDTMFPassThrough.new( - dtmf_pass_through: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SetDTMFPassThrough.new( + dtmf_pass_through: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::SetDTMFPassThrough.new( - dtmf_pass_through: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SetDTMFPassThrough.new( + dtmf_pass_through: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -58,6 +61,7 @@ it 'checks if properties are valid' do instance = Freeclimb::SetDTMFPassThrough.new( dtmf_pass_through: true, + ) expect(instance.valid?).to eq(true) end @@ -77,9 +81,11 @@ obj = Object.new() instance_1 = Freeclimb::SetDTMFPassThrough.new( dtmf_pass_through: true, + ) instance_2 = Freeclimb::SetDTMFPassThrough.new( dtmf_pass_through: true, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -87,9 +93,11 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::SetDTMFPassThrough.new( dtmf_pass_through: true, + ) instance_2 = Freeclimb::SetDTMFPassThrough.new( dtmf_pass_through: false, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -99,8 +107,9 @@ it 'calculates hash code' do instance = Freeclimb::SetDTMFPassThrough.new( dtmf_pass_through: true, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -108,8 +117,13 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::SetDTMFPassThrough.new( dtmf_pass_through: true, + ) - instance_2 = Freeclimb::SetDTMFPassThrough.new + instance_2 = Freeclimb::SetDTMFPassThrough.new( + dtmf_pass_through: true, + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -117,6 +131,7 @@ describe 'test method "_deserialize"' do instance = Freeclimb::SetDTMFPassThrough.new( dtmf_pass_through: true, + ) it 'deserializes the data of dtmf_pass_through' do expect(instance._deserialize("Boolean", instance.dtmf_pass_through)).to be_a_kind_of(TrueClass) @@ -127,6 +142,7 @@ it 'returns the string representation of the object' do instance = Freeclimb::SetDTMFPassThrough.new( dtmf_pass_through: true, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -136,6 +152,7 @@ it 'returns the object in the form of hash' do instance = Freeclimb::SetDTMFPassThrough.new( dtmf_pass_through: true, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -143,9 +160,11 @@ obj = Object.new() instance_1 = Freeclimb::SetDTMFPassThrough.new( dtmf_pass_through: true, + ) instance_2 = Freeclimb::SetDTMFPassThrough.new( dtmf_pass_through: true, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -154,6 +173,7 @@ describe 'test method "_to_hash"' do instance = Freeclimb::SetDTMFPassThrough.new( dtmf_pass_through: true, + ) it 'returns dtmf_pass_through in the form of hash' do expect(instance._to_hash(instance.dtmf_pass_through)).to eq(instance.dtmf_pass_through) diff --git a/spec/models/set_listen_spec.rb b/spec/models/set_listen_spec.rb index 3e162cd8..0056135b 100644 --- a/spec/models/set_listen_spec.rb +++ b/spec/models/set_listen_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -36,21 +36,24 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::SetListen.new( - listen: true, - )}.not_to raise_error() + expect { instance = Freeclimb::SetListen.new( + listen: true, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::SetListen' do - expect{instance = Freeclimb::SetListen.new( - listen: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SetListen.new( + listen: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::SetListen.new( - listen: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SetListen.new( + listen: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -58,6 +61,7 @@ it 'checks if properties are valid' do instance = Freeclimb::SetListen.new( listen: true, + ) expect(instance.valid?).to eq(true) end @@ -77,9 +81,11 @@ obj = Object.new() instance_1 = Freeclimb::SetListen.new( listen: true, + ) instance_2 = Freeclimb::SetListen.new( listen: true, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -87,9 +93,11 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::SetListen.new( listen: true, + ) instance_2 = Freeclimb::SetListen.new( listen: false, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -99,8 +107,9 @@ it 'calculates hash code' do instance = Freeclimb::SetListen.new( listen: true, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -108,8 +117,13 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::SetListen.new( listen: true, + ) - instance_2 = Freeclimb::SetListen.new + instance_2 = Freeclimb::SetListen.new( + listen: true, + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -117,6 +131,7 @@ describe 'test method "_deserialize"' do instance = Freeclimb::SetListen.new( listen: true, + ) it 'deserializes the data of listen' do expect(instance._deserialize("Boolean", instance.listen)).to be_a_kind_of(TrueClass) @@ -127,6 +142,7 @@ it 'returns the string representation of the object' do instance = Freeclimb::SetListen.new( listen: true, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -136,6 +152,7 @@ it 'returns the object in the form of hash' do instance = Freeclimb::SetListen.new( listen: true, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -143,9 +160,11 @@ obj = Object.new() instance_1 = Freeclimb::SetListen.new( listen: true, + ) instance_2 = Freeclimb::SetListen.new( listen: true, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -154,6 +173,7 @@ describe 'test method "_to_hash"' do instance = Freeclimb::SetListen.new( listen: true, + ) it 'returns listen in the form of hash' do expect(instance._to_hash(instance.listen)).to eq(instance.listen) diff --git a/spec/models/set_talk_spec.rb b/spec/models/set_talk_spec.rb index 97c0e81a..ca5ff632 100644 --- a/spec/models/set_talk_spec.rb +++ b/spec/models/set_talk_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -36,21 +36,24 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::SetTalk.new( - talk: true, - )}.not_to raise_error() + expect { instance = Freeclimb::SetTalk.new( + talk: true, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::SetTalk' do - expect{instance = Freeclimb::SetTalk.new( - talk: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SetTalk.new( + talk: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::SetTalk.new( - talk: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SetTalk.new( + talk: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -58,6 +61,7 @@ it 'checks if properties are valid' do instance = Freeclimb::SetTalk.new( talk: true, + ) expect(instance.valid?).to eq(true) end @@ -77,9 +81,11 @@ obj = Object.new() instance_1 = Freeclimb::SetTalk.new( talk: true, + ) instance_2 = Freeclimb::SetTalk.new( talk: true, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -87,9 +93,11 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::SetTalk.new( talk: true, + ) instance_2 = Freeclimb::SetTalk.new( talk: false, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -99,8 +107,9 @@ it 'calculates hash code' do instance = Freeclimb::SetTalk.new( talk: true, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -108,8 +117,13 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::SetTalk.new( talk: true, + ) - instance_2 = Freeclimb::SetTalk.new + instance_2 = Freeclimb::SetTalk.new( + talk: true, + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -117,6 +131,7 @@ describe 'test method "_deserialize"' do instance = Freeclimb::SetTalk.new( talk: true, + ) it 'deserializes the data of talk' do expect(instance._deserialize("Boolean", instance.talk)).to be_a_kind_of(TrueClass) @@ -127,6 +142,7 @@ it 'returns the string representation of the object' do instance = Freeclimb::SetTalk.new( talk: true, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -136,6 +152,7 @@ it 'returns the object in the form of hash' do instance = Freeclimb::SetTalk.new( talk: true, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -143,9 +160,11 @@ obj = Object.new() instance_1 = Freeclimb::SetTalk.new( talk: true, + ) instance_2 = Freeclimb::SetTalk.new( talk: true, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -154,6 +173,7 @@ describe 'test method "_to_hash"' do instance = Freeclimb::SetTalk.new( talk: true, + ) it 'returns talk in the form of hash' do expect(instance._to_hash(instance.talk)).to eq(instance.talk) diff --git a/spec/models/sms_spec.rb b/spec/models/sms_spec.rb index d372cd92..e572fdf3 100644 --- a/spec/models/sms_spec.rb +++ b/spec/models/sms_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -60,30 +60,42 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::Sms.new( - to: "TS", - from: "TS", - text: "TS", - notification_url: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::Sms.new( + to: "TS", + + from: "TS", + + text: "TS", + + notification_url: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::Sms' do - expect{instance = Freeclimb::Sms.new( - to: "TS", - from: "TS", - text: "TS", - notification_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Sms.new( + to: "TS", + + from: "TS", + + text: "TS", + + notification_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::Sms.new( - to: "TS", - from: "TS", - text: "TS", - notification_url: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::Sms.new( + to: "TS", + + from: "TS", + + text: "TS", + + notification_url: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -91,9 +103,13 @@ it 'checks if properties are valid' do instance = Freeclimb::Sms.new( to: "TS", + from: "TS", + text: "TS", + notification_url: "TS", + ) expect(instance.valid?).to eq(true) end @@ -113,15 +129,23 @@ obj = Object.new() instance_1 = Freeclimb::Sms.new( to: "TS", + from: "TS", + text: "TS", + notification_url: "TS", + ) instance_2 = Freeclimb::Sms.new( to: "TS", + from: "TS", + text: "TS", + notification_url: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -129,15 +153,23 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::Sms.new( to: "TS", + from: "TS", + text: "TS", + notification_url: "TS", + ) instance_2 = Freeclimb::Sms.new( to: "ST", + from: "ST", + text: "ST", + notification_url: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -147,11 +179,15 @@ it 'calculates hash code' do instance = Freeclimb::Sms.new( to: "TS", + from: "TS", + text: "TS", + notification_url: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -159,11 +195,25 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::Sms.new( to: "TS", + + from: "TS", + + text: "TS", + + notification_url: "TS", + + ) + instance_2 = Freeclimb::Sms.new( + to: "TS", + from: "TS", + text: "TS", + notification_url: "TS", + ) - instance_2 = Freeclimb::Sms.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -171,9 +221,13 @@ describe 'test method "_deserialize"' do instance = Freeclimb::Sms.new( to: "TS", + from: "TS", + text: "TS", + notification_url: "TS", + ) it 'deserializes the data of to' do expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) @@ -193,9 +247,13 @@ it 'returns the string representation of the object' do instance = Freeclimb::Sms.new( to: "TS", + from: "TS", + text: "TS", + notification_url: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -205,9 +263,13 @@ it 'returns the object in the form of hash' do instance = Freeclimb::Sms.new( to: "TS", + from: "TS", + text: "TS", + notification_url: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -215,15 +277,23 @@ obj = Object.new() instance_1 = Freeclimb::Sms.new( to: "TS", + from: "TS", + text: "TS", + notification_url: "TS", + ) instance_2 = Freeclimb::Sms.new( to: "TS", + from: "TS", + text: "TS", + notification_url: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -232,12 +302,16 @@ describe 'test method "_to_hash"' do instance = Freeclimb::Sms.new( to: "TS", + from: "TS", + text: "TS", + notification_url: "TS", + ) it 'returns to in the form of hash' do expect(instance._to_hash(instance.to)).to eq(instance.to) diff --git a/spec/models/sms_ten_dlc_brand_alt_business_id_type_spec.rb b/spec/models/sms_ten_dlc_brand_alt_business_id_type_spec.rb new file mode 100644 index 00000000..532adf84 --- /dev/null +++ b/spec/models/sms_ten_dlc_brand_alt_business_id_type_spec.rb @@ -0,0 +1,93 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::SMSTenDLCBrandAltBusinessIdType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::SMSTenDLCBrandAltBusinessIdType do + let(:instance) { Freeclimb::SMSTenDLCBrandAltBusinessIdType.new } + + describe 'test an instance of SMSTenDLCBrandAltBusinessIdType' do + it 'should create an instance of SMSTenDLCBrandAltBusinessIdType' do + expect(instance).to be_instance_of(Freeclimb::SMSTenDLCBrandAltBusinessIdType) + end + end + + describe 'test attribute "NONE"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE = "NONE" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE + calculatedValue = Freeclimb::SMSTenDLCBrandAltBusinessIdType::build_from_hash("NONE") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "NONE" + calculatedValue = Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "DUNS"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandAltBusinessIdType::DUNS = "DUNS" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandAltBusinessIdType::DUNS + calculatedValue = Freeclimb::SMSTenDLCBrandAltBusinessIdType::build_from_hash("DUNS") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "DUNS" + calculatedValue = Freeclimb::SMSTenDLCBrandAltBusinessIdType::DUNS + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "GIIN"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandAltBusinessIdType::GIIN = "GIIN" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandAltBusinessIdType::GIIN + calculatedValue = Freeclimb::SMSTenDLCBrandAltBusinessIdType::build_from_hash("GIIN") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "GIIN" + calculatedValue = Freeclimb::SMSTenDLCBrandAltBusinessIdType::GIIN + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "LEI"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandAltBusinessIdType::LEI = "LEI" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandAltBusinessIdType::LEI + calculatedValue = Freeclimb::SMSTenDLCBrandAltBusinessIdType::build_from_hash("LEI") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "LEI" + calculatedValue = Freeclimb::SMSTenDLCBrandAltBusinessIdType::LEI + expect(expectedValue).to eq(calculatedValue) + end + end + +end diff --git a/spec/models/sms_ten_dlc_brand_entity_type_spec.rb b/spec/models/sms_ten_dlc_brand_entity_type_spec.rb new file mode 100644 index 00000000..03038be5 --- /dev/null +++ b/spec/models/sms_ten_dlc_brand_entity_type_spec.rb @@ -0,0 +1,109 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::SMSTenDLCBrandEntityType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::SMSTenDLCBrandEntityType do + let(:instance) { Freeclimb::SMSTenDLCBrandEntityType.new } + + describe 'test an instance of SMSTenDLCBrandEntityType' do + it 'should create an instance of SMSTenDLCBrandEntityType' do + expect(instance).to be_instance_of(Freeclimb::SMSTenDLCBrandEntityType) + end + end + + describe 'test attribute "PRIVATE_PROFIT"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT = "PRIVATE_PROFIT" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT + calculatedValue = Freeclimb::SMSTenDLCBrandEntityType::build_from_hash("PRIVATE_PROFIT") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "PRIVATE_PROFIT" + calculatedValue = Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "PUBLIC_PROFIT"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandEntityType::PUBLIC_PROFIT = "PUBLIC_PROFIT" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandEntityType::PUBLIC_PROFIT + calculatedValue = Freeclimb::SMSTenDLCBrandEntityType::build_from_hash("PUBLIC_PROFIT") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "PUBLIC_PROFIT" + calculatedValue = Freeclimb::SMSTenDLCBrandEntityType::PUBLIC_PROFIT + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "NON_PROFIT"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandEntityType::NON_PROFIT = "NON_PROFIT" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandEntityType::NON_PROFIT + calculatedValue = Freeclimb::SMSTenDLCBrandEntityType::build_from_hash("NON_PROFIT") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "NON_PROFIT" + calculatedValue = Freeclimb::SMSTenDLCBrandEntityType::NON_PROFIT + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "GOVERNMENT"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandEntityType::GOVERNMENT = "GOVERNMENT" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandEntityType::GOVERNMENT + calculatedValue = Freeclimb::SMSTenDLCBrandEntityType::build_from_hash("GOVERNMENT") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "GOVERNMENT" + calculatedValue = Freeclimb::SMSTenDLCBrandEntityType::GOVERNMENT + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "SOLE_PROPRIETOR"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandEntityType::SOLE_PROPRIETOR = "SOLE_PROPRIETOR" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandEntityType::SOLE_PROPRIETOR + calculatedValue = Freeclimb::SMSTenDLCBrandEntityType::build_from_hash("SOLE_PROPRIETOR") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "SOLE_PROPRIETOR" + calculatedValue = Freeclimb::SMSTenDLCBrandEntityType::SOLE_PROPRIETOR + expect(expectedValue).to eq(calculatedValue) + end + end + +end diff --git a/spec/models/sms_ten_dlc_brand_identity_status_spec.rb b/spec/models/sms_ten_dlc_brand_identity_status_spec.rb new file mode 100644 index 00000000..c639ef5e --- /dev/null +++ b/spec/models/sms_ten_dlc_brand_identity_status_spec.rb @@ -0,0 +1,93 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::SMSTenDLCBrandIdentityStatus +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::SMSTenDLCBrandIdentityStatus do + let(:instance) { Freeclimb::SMSTenDLCBrandIdentityStatus.new } + + describe 'test an instance of SMSTenDLCBrandIdentityStatus' do + it 'should create an instance of SMSTenDLCBrandIdentityStatus' do + expect(instance).to be_instance_of(Freeclimb::SMSTenDLCBrandIdentityStatus) + end + end + + describe 'test attribute "SELF_DECLARED"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED = "SELF_DECLARED" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED + calculatedValue = Freeclimb::SMSTenDLCBrandIdentityStatus::build_from_hash("SELF_DECLARED") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "SELF_DECLARED" + calculatedValue = Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "UNVERIFIED"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandIdentityStatus::UNVERIFIED = "UNVERIFIED" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandIdentityStatus::UNVERIFIED + calculatedValue = Freeclimb::SMSTenDLCBrandIdentityStatus::build_from_hash("UNVERIFIED") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "UNVERIFIED" + calculatedValue = Freeclimb::SMSTenDLCBrandIdentityStatus::UNVERIFIED + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "VERIFIED"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandIdentityStatus::VERIFIED = "VERIFIED" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandIdentityStatus::VERIFIED + calculatedValue = Freeclimb::SMSTenDLCBrandIdentityStatus::build_from_hash("VERIFIED") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "VERIFIED" + calculatedValue = Freeclimb::SMSTenDLCBrandIdentityStatus::VERIFIED + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "VETTED_VERIFIED"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandIdentityStatus::VETTED_VERIFIED = "VETTED_VERIFIED" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandIdentityStatus::VETTED_VERIFIED + calculatedValue = Freeclimb::SMSTenDLCBrandIdentityStatus::build_from_hash("VETTED_VERIFIED") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "VETTED_VERIFIED" + calculatedValue = Freeclimb::SMSTenDLCBrandIdentityStatus::VETTED_VERIFIED + expect(expectedValue).to eq(calculatedValue) + end + end + +end diff --git a/spec/models/sms_ten_dlc_brand_relationship_spec.rb b/spec/models/sms_ten_dlc_brand_relationship_spec.rb new file mode 100644 index 00000000..3031a550 --- /dev/null +++ b/spec/models/sms_ten_dlc_brand_relationship_spec.rb @@ -0,0 +1,109 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::SMSTenDLCBrandRelationship +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::SMSTenDLCBrandRelationship do + let(:instance) { Freeclimb::SMSTenDLCBrandRelationship.new } + + describe 'test an instance of SMSTenDLCBrandRelationship' do + it 'should create an instance of SMSTenDLCBrandRelationship' do + expect(instance).to be_instance_of(Freeclimb::SMSTenDLCBrandRelationship) + end + end + + describe 'test attribute "BASIC_ACCOUNT"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT = "BASIC_ACCOUNT" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT + calculatedValue = Freeclimb::SMSTenDLCBrandRelationship::build_from_hash("BASIC_ACCOUNT") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "BASIC_ACCOUNT" + calculatedValue = Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "SMALL_ACCOUNT"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandRelationship::SMALL_ACCOUNT = "SMALL_ACCOUNT" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandRelationship::SMALL_ACCOUNT + calculatedValue = Freeclimb::SMSTenDLCBrandRelationship::build_from_hash("SMALL_ACCOUNT") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "SMALL_ACCOUNT" + calculatedValue = Freeclimb::SMSTenDLCBrandRelationship::SMALL_ACCOUNT + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "MEDIUM_ACCOUNT"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandRelationship::MEDIUM_ACCOUNT = "MEDIUM_ACCOUNT" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandRelationship::MEDIUM_ACCOUNT + calculatedValue = Freeclimb::SMSTenDLCBrandRelationship::build_from_hash("MEDIUM_ACCOUNT") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "MEDIUM_ACCOUNT" + calculatedValue = Freeclimb::SMSTenDLCBrandRelationship::MEDIUM_ACCOUNT + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "LARGE_ACCOUNT"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandRelationship::LARGE_ACCOUNT = "LARGE_ACCOUNT" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandRelationship::LARGE_ACCOUNT + calculatedValue = Freeclimb::SMSTenDLCBrandRelationship::build_from_hash("LARGE_ACCOUNT") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "LARGE_ACCOUNT" + calculatedValue = Freeclimb::SMSTenDLCBrandRelationship::LARGE_ACCOUNT + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "KEY_ACCOUNT"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandRelationship::KEY_ACCOUNT = "KEY_ACCOUNT" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandRelationship::KEY_ACCOUNT + calculatedValue = Freeclimb::SMSTenDLCBrandRelationship::build_from_hash("KEY_ACCOUNT") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "KEY_ACCOUNT" + calculatedValue = Freeclimb::SMSTenDLCBrandRelationship::KEY_ACCOUNT + expect(expectedValue).to eq(calculatedValue) + end + end + +end diff --git a/spec/models/sms_ten_dlc_brand_spec.rb b/spec/models/sms_ten_dlc_brand_spec.rb index cc93f535..6434e547 100644 --- a/spec/models/sms_ten_dlc_brand_spec.rb +++ b/spec/models/sms_ten_dlc_brand_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -36,38 +36,27 @@ describe 'test attribute "entity_type"' do - it 'assigns value PRIVATE_PROFIT' do - instance.entity_type = "PRIVATE_PROFIT" - expect(instance.entity_type).to eq("PRIVATE_PROFIT") + instance.entity_type = Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT + expect(instance.entity_type).to eq(Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT) end - it 'assigns value PUBLIC_PROFIT' do - instance.entity_type = "PUBLIC_PROFIT" - expect(instance.entity_type).to eq("PUBLIC_PROFIT") + instance.entity_type = Freeclimb::SMSTenDLCBrandEntityType::PUBLIC_PROFIT + expect(instance.entity_type).to eq(Freeclimb::SMSTenDLCBrandEntityType::PUBLIC_PROFIT) end - it 'assigns value NON_PROFIT' do - instance.entity_type = "NON_PROFIT" - expect(instance.entity_type).to eq("NON_PROFIT") + instance.entity_type = Freeclimb::SMSTenDLCBrandEntityType::NON_PROFIT + expect(instance.entity_type).to eq(Freeclimb::SMSTenDLCBrandEntityType::NON_PROFIT) end - it 'assigns value GOVERNMENT' do - instance.entity_type = "GOVERNMENT" - expect(instance.entity_type).to eq("GOVERNMENT") + instance.entity_type = Freeclimb::SMSTenDLCBrandEntityType::GOVERNMENT + expect(instance.entity_type).to eq(Freeclimb::SMSTenDLCBrandEntityType::GOVERNMENT) end - it 'assigns value SOLE_PROPRIETOR' do - instance.entity_type = "SOLE_PROPRIETOR" - expect(instance.entity_type).to eq("SOLE_PROPRIETOR") - end - - it 'throws error on invalid enum' do - instance = Freeclimb::SMSTenDLCBrand.new - expect{instance.entity_type = "INVALID_ENUM"}.to raise_error(ArgumentError) + instance.entity_type = Freeclimb::SMSTenDLCBrandEntityType::SOLE_PROPRIETOR + expect(instance.entity_type).to eq(Freeclimb::SMSTenDLCBrandEntityType::SOLE_PROPRIETOR) end end - describe 'test attribute "csp_id"' do it 'should work' do instance.csp_id = "TEST_STRING" @@ -90,7 +79,7 @@ expect(instance.first_name).to eq("T" * 100) end it 'should not assign a value over maxLength' do - expect{instance.first_name = "T" * (100 + 1)}.to raise_error(ArgumentError) + expect { instance.first_name = "T" * (100 + 1) }.to raise_error(ArgumentError) end end @@ -100,7 +89,7 @@ expect(instance.last_name).to eq("T" * 100) end it 'should not assign a value over maxLength' do - expect{instance.last_name = "T" * (100 + 1)}.to raise_error(ArgumentError) + expect { instance.last_name = "T" * (100 + 1) }.to raise_error(ArgumentError) end end @@ -110,7 +99,7 @@ expect(instance.display_name).to eq("T" * 255) end it 'should not assign a value over maxLength' do - expect{instance.display_name = "T" * (255 + 1)}.to raise_error(ArgumentError) + expect { instance.display_name = "T" * (255 + 1) }.to raise_error(ArgumentError) end end @@ -120,7 +109,7 @@ expect(instance.company_name).to eq("T" * 255) end it 'should not assign a value over maxLength' do - expect{instance.company_name = "T" * (255 + 1)}.to raise_error(ArgumentError) + expect { instance.company_name = "T" * (255 + 1) }.to raise_error(ArgumentError) end end @@ -130,7 +119,7 @@ expect(instance.ein).to eq("T" * 21) end it 'should not assign a value over maxLength' do - expect{instance.ein = "T" * (21 + 1)}.to raise_error(ArgumentError) + expect { instance.ein = "T" * (21 + 1) }.to raise_error(ArgumentError) end end @@ -140,7 +129,7 @@ expect(instance.ein_issuing_country).to eq("T" * 2) end it 'should not assign a value over maxLength' do - expect{instance.ein_issuing_country = "T" * (2 + 1)}.to raise_error(ArgumentError) + expect { instance.ein_issuing_country = "T" * (2 + 1) }.to raise_error(ArgumentError) end end @@ -150,7 +139,7 @@ expect(instance.phone).to eq("T" * 20) end it 'should not assign a value over maxLength' do - expect{instance.phone = "T" * (20 + 1)}.to raise_error(ArgumentError) + expect { instance.phone = "T" * (20 + 1) }.to raise_error(ArgumentError) end end @@ -160,7 +149,7 @@ expect(instance.street).to eq("T" * 100) end it 'should not assign a value over maxLength' do - expect{instance.street = "T" * (100 + 1)}.to raise_error(ArgumentError) + expect { instance.street = "T" * (100 + 1) }.to raise_error(ArgumentError) end end @@ -170,7 +159,7 @@ expect(instance.city).to eq("T" * 100) end it 'should not assign a value over maxLength' do - expect{instance.city = "T" * (100 + 1)}.to raise_error(ArgumentError) + expect { instance.city = "T" * (100 + 1) }.to raise_error(ArgumentError) end end @@ -180,7 +169,7 @@ expect(instance.state).to eq("T" * 20) end it 'should not assign a value over maxLength' do - expect{instance.state = "T" * (20 + 1)}.to raise_error(ArgumentError) + expect { instance.state = "T" * (20 + 1) }.to raise_error(ArgumentError) end end @@ -190,7 +179,7 @@ expect(instance.postal_code).to eq("T" * 10) end it 'should not assign a value over maxLength' do - expect{instance.postal_code = "T" * (10 + 1)}.to raise_error(ArgumentError) + expect { instance.postal_code = "T" * (10 + 1) }.to raise_error(ArgumentError) end end @@ -200,7 +189,7 @@ expect(instance.country).to eq("T" * 2) end it 'should not assign a value over maxLength' do - expect{instance.country = "T" * (2 + 1)}.to raise_error(ArgumentError) + expect { instance.country = "T" * (2 + 1) }.to raise_error(ArgumentError) end end @@ -210,7 +199,7 @@ expect(instance.email).to eq("T" * 100) end it 'should not assign a value over maxLength' do - expect{instance.email = "T" * (100 + 1)}.to raise_error(ArgumentError) + expect { instance.email = "T" * (100 + 1) }.to raise_error(ArgumentError) end end @@ -220,161 +209,128 @@ expect(instance.stock_symbol).to eq("T" * 10) end it 'should not assign a value over maxLength' do - expect{instance.stock_symbol = "T" * (10 + 1)}.to raise_error(ArgumentError) + expect { instance.stock_symbol = "T" * (10 + 1) }.to raise_error(ArgumentError) end end describe 'test attribute "stock_exchange"' do - it 'assigns value NONE' do - instance.stock_exchange = "NONE" - expect(instance.stock_exchange).to eq("NONE") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::NONE + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::NONE) end - it 'assigns value NASDAQ' do - instance.stock_exchange = "NASDAQ" - expect(instance.stock_exchange).to eq("NASDAQ") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::NASDAQ + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::NASDAQ) end - it 'assigns value NYSE' do - instance.stock_exchange = "NYSE" - expect(instance.stock_exchange).to eq("NYSE") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::NYSE + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::NYSE) end - it 'assigns value AMEX' do - instance.stock_exchange = "AMEX" - expect(instance.stock_exchange).to eq("AMEX") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::AMEX + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::AMEX) end - it 'assigns value AMX' do - instance.stock_exchange = "AMX" - expect(instance.stock_exchange).to eq("AMX") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::AMX + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::AMX) end - it 'assigns value ASX' do - instance.stock_exchange = "ASX" - expect(instance.stock_exchange).to eq("ASX") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::ASX + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::ASX) end - it 'assigns value B3' do - instance.stock_exchange = "B3" - expect(instance.stock_exchange).to eq("B3") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::B3 + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::B3) end - it 'assigns value BME' do - instance.stock_exchange = "BME" - expect(instance.stock_exchange).to eq("BME") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::BME + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::BME) end - it 'assigns value BSE' do - instance.stock_exchange = "BSE" - expect(instance.stock_exchange).to eq("BSE") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::BSE + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::BSE) end - it 'assigns value FRA' do - instance.stock_exchange = "FRA" - expect(instance.stock_exchange).to eq("FRA") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::FRA + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::FRA) end - it 'assigns value ICEX' do - instance.stock_exchange = "ICEX" - expect(instance.stock_exchange).to eq("ICEX") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::ICEX + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::ICEX) end - it 'assigns value JPX' do - instance.stock_exchange = "JPX" - expect(instance.stock_exchange).to eq("JPX") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::JPX + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::JPX) end - it 'assigns value JSE' do - instance.stock_exchange = "JSE" - expect(instance.stock_exchange).to eq("JSE") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::JSE + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::JSE) end - it 'assigns value KRX' do - instance.stock_exchange = "KRX" - expect(instance.stock_exchange).to eq("KRX") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::KRX + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::KRX) end - it 'assigns value LON' do - instance.stock_exchange = "LON" - expect(instance.stock_exchange).to eq("LON") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::LON + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::LON) end - it 'assigns value NSE' do - instance.stock_exchange = "NSE" - expect(instance.stock_exchange).to eq("NSE") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::NSE + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::NSE) end - it 'assigns value OMX' do - instance.stock_exchange = "OMX" - expect(instance.stock_exchange).to eq("OMX") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::OMX + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::OMX) end - it 'assigns value SEHK' do - instance.stock_exchange = "SEHK" - expect(instance.stock_exchange).to eq("SEHK") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::SEHK + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::SEHK) end - it 'assigns value SGX' do - instance.stock_exchange = "SGX" - expect(instance.stock_exchange).to eq("SGX") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::SGX + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::SGX) end - it 'assigns value SSE' do - instance.stock_exchange = "SSE" - expect(instance.stock_exchange).to eq("SSE") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::SSE + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::SSE) end - it 'assigns value STO' do - instance.stock_exchange = "STO" - expect(instance.stock_exchange).to eq("STO") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::STO + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::STO) end - it 'assigns value SWX' do - instance.stock_exchange = "SWX" - expect(instance.stock_exchange).to eq("SWX") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::SWX + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::SWX) end - it 'assigns value SZSE' do - instance.stock_exchange = "SZSE" - expect(instance.stock_exchange).to eq("SZSE") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::SZSE + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::SZSE) end - it 'assigns value TSX' do - instance.stock_exchange = "TSX" - expect(instance.stock_exchange).to eq("TSX") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::TSX + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::TSX) end - it 'assigns value TWSE' do - instance.stock_exchange = "TWSE" - expect(instance.stock_exchange).to eq("TWSE") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::TWSE + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::TWSE) end - it 'assigns value VSE' do - instance.stock_exchange = "VSE" - expect(instance.stock_exchange).to eq("VSE") + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::VSE + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::VSE) end - it 'assigns value OTHER' do - instance.stock_exchange = "OTHER" - expect(instance.stock_exchange).to eq("OTHER") - end - - it 'throws error on invalid enum' do - instance = Freeclimb::SMSTenDLCBrand.new - expect{instance.stock_exchange = "INVALID_ENUM"}.to raise_error(ArgumentError) + instance.stock_exchange = Freeclimb::SMSTenDLCBrandStockExchange::OTHER + expect(instance.stock_exchange).to eq(Freeclimb::SMSTenDLCBrandStockExchange::OTHER) end end - describe 'test attribute "ip_address"' do it 'should assign a value of maxLength' do instance.ip_address = "T" * 50 expect(instance.ip_address).to eq("T" * 50) end it 'should not assign a value over maxLength' do - expect{instance.ip_address = "T" * (50 + 1)}.to raise_error(ArgumentError) + expect { instance.ip_address = "T" * (50 + 1) }.to raise_error(ArgumentError) end end @@ -384,51 +340,40 @@ expect(instance.website).to eq("T" * 100) end it 'should not assign a value over maxLength' do - expect{instance.website = "T" * (100 + 1)}.to raise_error(ArgumentError) + expect { instance.website = "T" * (100 + 1) }.to raise_error(ArgumentError) end end describe 'test attribute "brand_relationship"' do - it 'assigns value BASIC_ACCOUNT' do - instance.brand_relationship = "BASIC_ACCOUNT" - expect(instance.brand_relationship).to eq("BASIC_ACCOUNT") + instance.brand_relationship = Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT + expect(instance.brand_relationship).to eq(Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT) end - it 'assigns value SMALL_ACCOUNT' do - instance.brand_relationship = "SMALL_ACCOUNT" - expect(instance.brand_relationship).to eq("SMALL_ACCOUNT") + instance.brand_relationship = Freeclimb::SMSTenDLCBrandRelationship::SMALL_ACCOUNT + expect(instance.brand_relationship).to eq(Freeclimb::SMSTenDLCBrandRelationship::SMALL_ACCOUNT) end - it 'assigns value MEDIUM_ACCOUNT' do - instance.brand_relationship = "MEDIUM_ACCOUNT" - expect(instance.brand_relationship).to eq("MEDIUM_ACCOUNT") + instance.brand_relationship = Freeclimb::SMSTenDLCBrandRelationship::MEDIUM_ACCOUNT + expect(instance.brand_relationship).to eq(Freeclimb::SMSTenDLCBrandRelationship::MEDIUM_ACCOUNT) end - it 'assigns value LARGE_ACCOUNT' do - instance.brand_relationship = "LARGE_ACCOUNT" - expect(instance.brand_relationship).to eq("LARGE_ACCOUNT") + instance.brand_relationship = Freeclimb::SMSTenDLCBrandRelationship::LARGE_ACCOUNT + expect(instance.brand_relationship).to eq(Freeclimb::SMSTenDLCBrandRelationship::LARGE_ACCOUNT) end - it 'assigns value KEY_ACCOUNT' do - instance.brand_relationship = "KEY_ACCOUNT" - expect(instance.brand_relationship).to eq("KEY_ACCOUNT") - end - - it 'throws error on invalid enum' do - instance = Freeclimb::SMSTenDLCBrand.new - expect{instance.brand_relationship = "INVALID_ENUM"}.to raise_error(ArgumentError) + instance.brand_relationship = Freeclimb::SMSTenDLCBrandRelationship::KEY_ACCOUNT + expect(instance.brand_relationship).to eq(Freeclimb::SMSTenDLCBrandRelationship::KEY_ACCOUNT) end end - describe 'test attribute "vertical"' do it 'should assign a value of maxLength' do instance.vertical = "T" * 50 expect(instance.vertical).to eq("T" * 50) end it 'should not assign a value over maxLength' do - expect{instance.vertical = "T" * (50 + 1)}.to raise_error(ArgumentError) + expect { instance.vertical = "T" * (50 + 1) }.to raise_error(ArgumentError) end end @@ -438,39 +383,29 @@ expect(instance.alt_business_id).to eq("T" * 50) end it 'should not assign a value over maxLength' do - expect{instance.alt_business_id = "T" * (50 + 1)}.to raise_error(ArgumentError) + expect { instance.alt_business_id = "T" * (50 + 1) }.to raise_error(ArgumentError) end end describe 'test attribute "alt_business_id_type"' do - it 'assigns value NONE' do - instance.alt_business_id_type = "NONE" - expect(instance.alt_business_id_type).to eq("NONE") + instance.alt_business_id_type = Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE + expect(instance.alt_business_id_type).to eq(Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE) end - it 'assigns value DUNS' do - instance.alt_business_id_type = "DUNS" - expect(instance.alt_business_id_type).to eq("DUNS") + instance.alt_business_id_type = Freeclimb::SMSTenDLCBrandAltBusinessIdType::DUNS + expect(instance.alt_business_id_type).to eq(Freeclimb::SMSTenDLCBrandAltBusinessIdType::DUNS) end - it 'assigns value GIIN' do - instance.alt_business_id_type = "GIIN" - expect(instance.alt_business_id_type).to eq("GIIN") + instance.alt_business_id_type = Freeclimb::SMSTenDLCBrandAltBusinessIdType::GIIN + expect(instance.alt_business_id_type).to eq(Freeclimb::SMSTenDLCBrandAltBusinessIdType::GIIN) end - it 'assigns value LEI' do - instance.alt_business_id_type = "LEI" - expect(instance.alt_business_id_type).to eq("LEI") - end - - it 'throws error on invalid enum' do - instance = Freeclimb::SMSTenDLCBrand.new - expect{instance.alt_business_id_type = "INVALID_ENUM"}.to raise_error(ArgumentError) + instance.alt_business_id_type = Freeclimb::SMSTenDLCBrandAltBusinessIdType::LEI + expect(instance.alt_business_id_type).to eq(Freeclimb::SMSTenDLCBrandAltBusinessIdType::LEI) end end - describe 'test attribute "universal_ein"' do it 'should work' do instance.universal_ein = "TEST_STRING" @@ -485,7 +420,7 @@ expect(instance.reference_id).to eq("T" * 50) end it 'should not assign a value over maxLength' do - expect{instance.reference_id = "T" * (50 + 1)}.to raise_error(ArgumentError) + expect { instance.reference_id = "T" * (50 + 1) }.to raise_error(ArgumentError) end end @@ -508,33 +443,23 @@ describe 'test attribute "identity_status"' do - it 'assigns value SELF_DECLARED' do - instance.identity_status = "SELF_DECLARED" - expect(instance.identity_status).to eq("SELF_DECLARED") + instance.identity_status = Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED + expect(instance.identity_status).to eq(Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED) end - it 'assigns value UNVERIFIED' do - instance.identity_status = "UNVERIFIED" - expect(instance.identity_status).to eq("UNVERIFIED") + instance.identity_status = Freeclimb::SMSTenDLCBrandIdentityStatus::UNVERIFIED + expect(instance.identity_status).to eq(Freeclimb::SMSTenDLCBrandIdentityStatus::UNVERIFIED) end - it 'assigns value VERIFIED' do - instance.identity_status = "VERIFIED" - expect(instance.identity_status).to eq("VERIFIED") + instance.identity_status = Freeclimb::SMSTenDLCBrandIdentityStatus::VERIFIED + expect(instance.identity_status).to eq(Freeclimb::SMSTenDLCBrandIdentityStatus::VERIFIED) end - it 'assigns value VETTED_VERIFIED' do - instance.identity_status = "VETTED_VERIFIED" - expect(instance.identity_status).to eq("VETTED_VERIFIED") - end - - it 'throws error on invalid enum' do - instance = Freeclimb::SMSTenDLCBrand.new - expect{instance.identity_status = "INVALID_ENUM"}.to raise_error(ArgumentError) + instance.identity_status = Freeclimb::SMSTenDLCBrandIdentityStatus::VETTED_VERIFIED + expect(instance.identity_status).to eq(Freeclimb::SMSTenDLCBrandIdentityStatus::VETTED_VERIFIED) end end - describe 'test attribute "create_date"' do it 'should work' do instance.create_date = "2022-07-05T15:17:05Z" @@ -545,147 +470,291 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::SMSTenDLCBrand.new( + expect { instance = Freeclimb::SMSTenDLCBrand.new( + account_id: "TS", + + + entity_type: Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT, + + csp_id: "TS", + + brand_id: "TS", + + first_name: "TS", + + last_name: "TS", + + display_name: "TS", + + company_name: "TS", + + ein: "TS", + + ein_issuing_country: "TS", + + phone: "TS", + + street: "TS", + + city: "TS", + + state: "TS", + + postal_code: "TS", + + country: "TS", + + email: "TS", + + stock_symbol: "TS", + + + stock_exchange: Freeclimb::SMSTenDLCBrandStockExchange::NONE, + + ip_address: "TS", + + website: "TS", + + + brand_relationship: Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT, + + vertical: "TS", + + alt_business_id: "TS", + + + alt_business_id_type: Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE, + + universal_ein: "TS", + + reference_id: "TS", + + optional_attributes: Hash.new(), + + mock: true, + + + identity_status: Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED, + + + create_date: "2022-07-05T15:17:05Z", + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::SMSTenDLCBrand' do + expect { instance = Freeclimb::SMSTenDLCBrand.new( + account_id: "TS", + + + entity_type: Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT, + + csp_id: "TS", + + brand_id: "TS", + + first_name: "TS", + + last_name: "TS", + + display_name: "TS", + + company_name: "TS", + + ein: "TS", + + ein_issuing_country: "TS", + + phone: "TS", + + street: "TS", + + city: "TS", + + state: "TS", + + postal_code: "TS", + + country: "TS", + + email: "TS", + + stock_symbol: "TS", + + + stock_exchange: Freeclimb::SMSTenDLCBrandStockExchange::NONE, + + ip_address: "TS", + + website: "TS", + + + brand_relationship: Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT, + + vertical: "TS", + + alt_business_id: "TS", + + + alt_business_id_type: Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE, + + universal_ein: "TS", + + reference_id: "TS", + + optional_attributes: Hash.new(), + + mock: true, + + + identity_status: Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED, + + + create_date: "2022-07-05T15:17:05Z", + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::SMSTenDLCBrand.new( + account_id: "TS", + + + entity_type: Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT, + + csp_id: "TS", + + brand_id: "TS", + + first_name: "TS", + + last_name: "TS", + + display_name: "TS", + + company_name: "TS", + + ein: "TS", + + ein_issuing_country: "TS", + + phone: "TS", + + street: "TS", + + city: "TS", + + state: "TS", + + postal_code: "TS", + + country: "TS", + + email: "TS", + + stock_symbol: "TS", + + + stock_exchange: Freeclimb::SMSTenDLCBrandStockExchange::NONE, + + ip_address: "TS", + + website: "TS", + + + brand_relationship: Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT, + + vertical: "TS", + + alt_business_id: "TS", + + + alt_business_id_type: Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE, + + universal_ein: "TS", + + reference_id: "TS", + + optional_attributes: Hash.new(), + + mock: true, + + + identity_status: Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED, + + + create_date: "2022-07-05T15:17:05Z", + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::SMSTenDLCBrand.new( account_id: "TS", - entity_type:"PRIVATE_PROFIT", + + + entity_type: Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT, + csp_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + ein: "TS", + ein_issuing_country: "TS", + phone: "TS", + street: "TS", + city: "TS", + state: "TS", + postal_code: "TS", + country: "TS", + email: "TS", + stock_symbol: "TS", - stock_exchange:"NONE", + + + stock_exchange: Freeclimb::SMSTenDLCBrandStockExchange::NONE, + ip_address: "TS", + website: "TS", - brand_relationship:"BASIC_ACCOUNT", + + + brand_relationship: Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT, + vertical: "TS", + alt_business_id: "TS", - alt_business_id_type:"NONE", + + + alt_business_id_type: Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE, + universal_ein: "TS", + reference_id: "TS", + optional_attributes: Hash.new(), + mock: true, - identity_status:"SELF_DECLARED", - create_date: "2022-07-05T15:17:05Z", - )}.not_to raise_error() - end - it 'fails to initialize with input argument that is not a hash in Freeclimb::SMSTenDLCBrand' do - expect{instance = Freeclimb::SMSTenDLCBrand.new( - account_id: "TS", - entity_type:"PRIVATE_PROFIT", - csp_id: "TS", - brand_id: "TS", - first_name: "TS", - last_name: "TS", - display_name: "TS", - company_name: "TS", - ein: "TS", - ein_issuing_country: "TS", - phone: "TS", - street: "TS", - city: "TS", - state: "TS", - postal_code: "TS", - country: "TS", - email: "TS", - stock_symbol: "TS", - stock_exchange:"NONE", - ip_address: "TS", - website: "TS", - brand_relationship:"BASIC_ACCOUNT", - vertical: "TS", - alt_business_id: "TS", - alt_business_id_type:"NONE", - universal_ein: "TS", - reference_id: "TS", - optional_attributes: Hash.new(), - mock: true, - identity_status:"SELF_DECLARED", - create_date: "2022-07-05T15:17:05Z", - invalid_attribute: true - )}.to raise_error(ArgumentError) - end - it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::SMSTenDLCBrand.new( - account_id: "TS", - entity_type:"PRIVATE_PROFIT", - csp_id: "TS", - brand_id: "TS", - first_name: "TS", - last_name: "TS", - display_name: "TS", - company_name: "TS", - ein: "TS", - ein_issuing_country: "TS", - phone: "TS", - street: "TS", - city: "TS", - state: "TS", - postal_code: "TS", - country: "TS", - email: "TS", - stock_symbol: "TS", - stock_exchange:"NONE", - ip_address: "TS", - website: "TS", - brand_relationship:"BASIC_ACCOUNT", - vertical: "TS", - alt_business_id: "TS", - alt_business_id_type:"NONE", - universal_ein: "TS", - reference_id: "TS", - optional_attributes: Hash.new(), - mock: true, - identity_status:"SELF_DECLARED", - create_date: "2022-07-05T15:17:05Z", - invalid_attribute: true - )}.to raise_error(ArgumentError) - end - end - - describe 'test method "valid"' do - it 'checks if properties are valid' do - instance = Freeclimb::SMSTenDLCBrand.new( - account_id: "TS", - entity_type:"PRIVATE_PROFIT", - csp_id: "TS", - brand_id: "TS", - first_name: "TS", - last_name: "TS", - display_name: "TS", - company_name: "TS", - ein: "TS", - ein_issuing_country: "TS", - phone: "TS", - street: "TS", - city: "TS", - state: "TS", - postal_code: "TS", - country: "TS", - email: "TS", - stock_symbol: "TS", - stock_exchange:"NONE", - ip_address: "TS", - website: "TS", - brand_relationship:"BASIC_ACCOUNT", - vertical: "TS", - alt_business_id: "TS", - alt_business_id_type:"NONE", - universal_ein: "TS", - reference_id: "TS", - optional_attributes: Hash.new(), - mock: true, - identity_status:"SELF_DECLARED", + + + identity_status: Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED, + + create_date: "2022-07-05T15:17:05Z", ) expect(instance.valid?).to eq(true) @@ -706,65 +775,137 @@ obj = Object.new() instance_1 = Freeclimb::SMSTenDLCBrand.new( account_id: "TS", - entity_type:"PRIVATE_PROFIT", + + + entity_type: Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT, + csp_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + ein: "TS", + ein_issuing_country: "TS", + phone: "TS", + street: "TS", + city: "TS", + state: "TS", + postal_code: "TS", + country: "TS", + email: "TS", + stock_symbol: "TS", - stock_exchange:"NONE", + + + stock_exchange: Freeclimb::SMSTenDLCBrandStockExchange::NONE, + ip_address: "TS", + website: "TS", - brand_relationship:"BASIC_ACCOUNT", + + + brand_relationship: Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT, + vertical: "TS", + alt_business_id: "TS", - alt_business_id_type:"NONE", + + + alt_business_id_type: Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE, + universal_ein: "TS", + reference_id: "TS", + + mock: true, - identity_status:"SELF_DECLARED", + + + identity_status: Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED, + + ) instance_2 = Freeclimb::SMSTenDLCBrand.new( account_id: "TS", - entity_type:"PRIVATE_PROFIT", + + + entity_type: Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT, + csp_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + ein: "TS", + ein_issuing_country: "TS", + phone: "TS", + street: "TS", + city: "TS", + state: "TS", + postal_code: "TS", + country: "TS", + email: "TS", + stock_symbol: "TS", - stock_exchange:"NONE", + + + stock_exchange: Freeclimb::SMSTenDLCBrandStockExchange::NONE, + ip_address: "TS", + website: "TS", - brand_relationship:"BASIC_ACCOUNT", + + + brand_relationship: Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT, + vertical: "TS", + alt_business_id: "TS", - alt_business_id_type:"NONE", + + + alt_business_id_type: Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE, + universal_ein: "TS", + reference_id: "TS", + + mock: true, - identity_status:"SELF_DECLARED", + + + identity_status: Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED, + + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -772,65 +913,137 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::SMSTenDLCBrand.new( account_id: "TS", - entity_type:"PRIVATE_PROFIT", + + + entity_type: Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT, + csp_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + ein: "TS", + ein_issuing_country: "TS", + phone: "TS", + street: "TS", + city: "TS", + state: "TS", + postal_code: "TS", + country: "TS", + email: "TS", + stock_symbol: "TS", - stock_exchange:"NONE", + + + stock_exchange: Freeclimb::SMSTenDLCBrandStockExchange::NONE, + ip_address: "TS", + website: "TS", - brand_relationship:"BASIC_ACCOUNT", + + + brand_relationship: Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT, + vertical: "TS", + alt_business_id: "TS", - alt_business_id_type:"NONE", + + + alt_business_id_type: Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE, + universal_ein: "TS", + reference_id: "TS", + + mock: true, - identity_status:"SELF_DECLARED", + + + identity_status: Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED, + + ) instance_2 = Freeclimb::SMSTenDLCBrand.new( account_id: "ST", - entity_type:"PRIVATE_PROFIT", + + + entity_type: nil, + csp_id: "ST", + brand_id: "ST", + first_name: "ST", + last_name: "ST", + display_name: "ST", + company_name: "ST", + ein: "ST", + ein_issuing_country: "ST", + phone: "ST", + street: "ST", + city: "ST", + state: "ST", + postal_code: "ST", + country: "ST", + email: "ST", + stock_symbol: "ST", - stock_exchange:"NONE", + + + stock_exchange: nil, + ip_address: "ST", + website: "ST", - brand_relationship:"BASIC_ACCOUNT", + + + brand_relationship: nil, + vertical: "ST", + alt_business_id: "ST", - alt_business_id_type:"NONE", + + + alt_business_id_type: nil, + universal_ein: "ST", + reference_id: "ST", + + mock: false, - identity_status:"SELF_DECLARED", + + + identity_status: nil, + + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -840,38 +1053,74 @@ it 'calculates hash code' do instance = Freeclimb::SMSTenDLCBrand.new( account_id: "TS", - entity_type:"PRIVATE_PROFIT", + + + entity_type: Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT, + csp_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + ein: "TS", + ein_issuing_country: "TS", + phone: "TS", + street: "TS", + city: "TS", + state: "TS", + postal_code: "TS", + country: "TS", + email: "TS", + stock_symbol: "TS", - stock_exchange:"NONE", + + + stock_exchange: Freeclimb::SMSTenDLCBrandStockExchange::NONE, + ip_address: "TS", + website: "TS", - brand_relationship:"BASIC_ACCOUNT", + + + brand_relationship: Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT, + vertical: "TS", + alt_business_id: "TS", - alt_business_id_type:"NONE", + + + alt_business_id_type: Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE, + universal_ein: "TS", + reference_id: "TS", + optional_attributes: Hash.new(), + mock: true, - identity_status:"SELF_DECLARED", + + + identity_status: Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED, + + create_date: "2022-07-05T15:17:05Z", ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -879,38 +1128,143 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::SMSTenDLCBrand.new( account_id: "TS", - entity_type:"PRIVATE_PROFIT", + + + entity_type: Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT, + csp_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + ein: "TS", + ein_issuing_country: "TS", + phone: "TS", + street: "TS", + city: "TS", + state: "TS", + postal_code: "TS", + country: "TS", + email: "TS", + stock_symbol: "TS", - stock_exchange:"NONE", + + + stock_exchange: Freeclimb::SMSTenDLCBrandStockExchange::NONE, + ip_address: "TS", + website: "TS", - brand_relationship:"BASIC_ACCOUNT", + + + brand_relationship: Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT, + vertical: "TS", + alt_business_id: "TS", - alt_business_id_type:"NONE", + + + alt_business_id_type: Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE, + universal_ein: "TS", + reference_id: "TS", + optional_attributes: Hash.new(), + mock: true, - identity_status:"SELF_DECLARED", + + + identity_status: Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED, + + + create_date: "2022-07-05T15:17:05Z", + ) + instance_2 = Freeclimb::SMSTenDLCBrand.new( + account_id: "TS", + + + entity_type: Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT, + + csp_id: "TS", + + brand_id: "TS", + + first_name: "TS", + + last_name: "TS", + + display_name: "TS", + + company_name: "TS", + + ein: "TS", + + ein_issuing_country: "TS", + + phone: "TS", + + street: "TS", + + city: "TS", + + state: "TS", + + postal_code: "TS", + + country: "TS", + + email: "TS", + + stock_symbol: "TS", + + + stock_exchange: Freeclimb::SMSTenDLCBrandStockExchange::NONE, + + ip_address: "TS", + + website: "TS", + + + brand_relationship: Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT, + + vertical: "TS", + + alt_business_id: "TS", + + + alt_business_id_type: Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE, + + universal_ein: "TS", + + reference_id: "TS", + + optional_attributes: Hash.new(), + + mock: true, + + + identity_status: Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED, + + create_date: "2022-07-05T15:17:05Z", ) - instance_2 = Freeclimb::SMSTenDLCBrand.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -918,43 +1272,76 @@ describe 'test method "_deserialize"' do instance = Freeclimb::SMSTenDLCBrand.new( account_id: "TS", - entity_type:"PRIVATE_PROFIT", + + + entity_type: Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT, + csp_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + ein: "TS", + ein_issuing_country: "TS", + phone: "TS", + street: "TS", + city: "TS", + state: "TS", + postal_code: "TS", + country: "TS", + email: "TS", + stock_symbol: "TS", - stock_exchange:"NONE", + + + stock_exchange: Freeclimb::SMSTenDLCBrandStockExchange::NONE, + ip_address: "TS", + website: "TS", - brand_relationship:"BASIC_ACCOUNT", + + + brand_relationship: Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT, + vertical: "TS", + alt_business_id: "TS", - alt_business_id_type:"NONE", + + + alt_business_id_type: Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE, + universal_ein: "TS", + reference_id: "TS", + optional_attributes: Hash.new(), + mock: true, - identity_status:"SELF_DECLARED", + + + identity_status: Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED, + + create_date: "2022-07-05T15:17:05Z", ) it 'deserializes the data of account_id' do expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) end - it 'deserializes the data of entity_type' do - expect(instance._deserialize("String", instance.entity_type)).to be_a_kind_of(String) - end it 'deserializes the data of csp_id' do expect(instance._deserialize("String", instance.csp_id)).to be_a_kind_of(String) end @@ -1003,27 +1390,18 @@ it 'deserializes the data of stock_symbol' do expect(instance._deserialize("String", instance.stock_symbol)).to be_a_kind_of(String) end - it 'deserializes the data of stock_exchange' do - expect(instance._deserialize("String", instance.stock_exchange)).to be_a_kind_of(String) - end it 'deserializes the data of ip_address' do expect(instance._deserialize("String", instance.ip_address)).to be_a_kind_of(String) end it 'deserializes the data of website' do expect(instance._deserialize("String", instance.website)).to be_a_kind_of(String) end - it 'deserializes the data of brand_relationship' do - expect(instance._deserialize("String", instance.brand_relationship)).to be_a_kind_of(String) - end it 'deserializes the data of vertical' do expect(instance._deserialize("String", instance.vertical)).to be_a_kind_of(String) end it 'deserializes the data of alt_business_id' do expect(instance._deserialize("String", instance.alt_business_id)).to be_a_kind_of(String) end - it 'deserializes the data of alt_business_id_type' do - expect(instance._deserialize("String", instance.alt_business_id_type)).to be_a_kind_of(String) - end it 'deserializes the data of universal_ein' do expect(instance._deserialize("String", instance.universal_ein)).to be_a_kind_of(String) end @@ -1036,9 +1414,6 @@ it 'deserializes the data of mock' do expect(instance._deserialize("Boolean", instance.mock)).to be_a_kind_of(TrueClass) end - it 'deserializes the data of identity_status' do - expect(instance._deserialize("String", instance.identity_status)).to be_a_kind_of(String) - end it 'deserializes the data of create_date' do expect(instance._deserialize("Time", instance.create_date)).to be_a_kind_of(Time) end @@ -1048,35 +1423,71 @@ it 'returns the string representation of the object' do instance = Freeclimb::SMSTenDLCBrand.new( account_id: "TS", - entity_type:"PRIVATE_PROFIT", + + + entity_type: Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT, + csp_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + ein: "TS", + ein_issuing_country: "TS", + phone: "TS", + street: "TS", + city: "TS", + state: "TS", + postal_code: "TS", + country: "TS", + email: "TS", + stock_symbol: "TS", - stock_exchange:"NONE", + + + stock_exchange: Freeclimb::SMSTenDLCBrandStockExchange::NONE, + ip_address: "TS", + website: "TS", - brand_relationship:"BASIC_ACCOUNT", + + + brand_relationship: Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT, + vertical: "TS", + alt_business_id: "TS", - alt_business_id_type:"NONE", + + + alt_business_id_type: Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE, + universal_ein: "TS", + reference_id: "TS", + optional_attributes: Hash.new(), + mock: true, - identity_status:"SELF_DECLARED", + + + identity_status: Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED, + + create_date: "2022-07-05T15:17:05Z", ) expect(instance.to_s).to eq(instance.to_hash.to_s) @@ -1087,35 +1498,71 @@ it 'returns the object in the form of hash' do instance = Freeclimb::SMSTenDLCBrand.new( account_id: "TS", - entity_type:"PRIVATE_PROFIT", + + + entity_type: Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT, + csp_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + ein: "TS", + ein_issuing_country: "TS", + phone: "TS", + street: "TS", + city: "TS", + state: "TS", + postal_code: "TS", + country: "TS", + email: "TS", + stock_symbol: "TS", - stock_exchange:"NONE", + + + stock_exchange: Freeclimb::SMSTenDLCBrandStockExchange::NONE, + ip_address: "TS", + website: "TS", - brand_relationship:"BASIC_ACCOUNT", + + + brand_relationship: Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT, + vertical: "TS", + alt_business_id: "TS", - alt_business_id_type:"NONE", + + + alt_business_id_type: Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE, + universal_ein: "TS", + reference_id: "TS", + optional_attributes: Hash.new(), + mock: true, - identity_status:"SELF_DECLARED", + + + identity_status: Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED, + + create_date: "2022-07-05T15:17:05Z", ) expect(instance.to_hash).to be_a_kind_of(Hash) @@ -1124,68 +1571,140 @@ obj = Object.new() instance_1 = Freeclimb::SMSTenDLCBrand.new( account_id: "TS", - entity_type:"PRIVATE_PROFIT", + + + entity_type: Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT, + csp_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + ein: "TS", + ein_issuing_country: "TS", + phone: "TS", + street: "TS", + city: "TS", + state: "TS", + postal_code: "TS", + country: "TS", + email: "TS", + stock_symbol: "TS", - stock_exchange:"NONE", + + + stock_exchange: Freeclimb::SMSTenDLCBrandStockExchange::NONE, + ip_address: "TS", + website: "TS", - brand_relationship:"BASIC_ACCOUNT", + + + brand_relationship: Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT, + vertical: "TS", + alt_business_id: "TS", - alt_business_id_type:"NONE", + + + alt_business_id_type: Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE, + universal_ein: "TS", + reference_id: "TS", + optional_attributes: Hash.new(), + mock: true, - identity_status:"SELF_DECLARED", + + + identity_status: Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED, + + create_date: "2022-07-05T15:17:05Z", ) instance_2 = Freeclimb::SMSTenDLCBrand.new( account_id: "TS", - entity_type:"PRIVATE_PROFIT", + + + entity_type: Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT, + csp_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + ein: "TS", + ein_issuing_country: "TS", + phone: "TS", + street: "TS", + city: "TS", + state: "TS", + postal_code: "TS", + country: "TS", + email: "TS", + stock_symbol: "TS", - stock_exchange:"NONE", + + + stock_exchange: Freeclimb::SMSTenDLCBrandStockExchange::NONE, + ip_address: "TS", + website: "TS", - brand_relationship:"BASIC_ACCOUNT", + + + brand_relationship: Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT, + vertical: "TS", + alt_business_id: "TS", - alt_business_id_type:"NONE", + + + alt_business_id_type: Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE, + universal_ein: "TS", + reference_id: "TS", + optional_attributes: Hash.new(), + mock: true, - identity_status:"SELF_DECLARED", + + + identity_status: Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED, + + create_date: "2022-07-05T15:17:05Z", ) expect(instance_1.to_hash).to eq(instance_2.to_hash) @@ -1195,65 +1714,101 @@ describe 'test method "_to_hash"' do instance = Freeclimb::SMSTenDLCBrand.new( account_id: "TS", + - entity_type:"PRIVATE_PROFIT", + + entity_type: Freeclimb::SMSTenDLCBrandEntityType::PRIVATE_PROFIT, + csp_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + ein: "TS", + ein_issuing_country: "TS", + phone: "TS", + street: "TS", + city: "TS", + state: "TS", + postal_code: "TS", + country: "TS", + email: "TS", + stock_symbol: "TS", + - stock_exchange:"NONE", + + stock_exchange: Freeclimb::SMSTenDLCBrandStockExchange::NONE, + ip_address: "TS", + website: "TS", + - brand_relationship:"BASIC_ACCOUNT", + + brand_relationship: Freeclimb::SMSTenDLCBrandRelationship::BASIC_ACCOUNT, + vertical: "TS", + alt_business_id: "TS", + - alt_business_id_type:"NONE", + + alt_business_id_type: Freeclimb::SMSTenDLCBrandAltBusinessIdType::NONE, + universal_ein: "TS", + reference_id: "TS", + optional_attributes: Hash.new(), + mock: true, + - identity_status:"SELF_DECLARED", + + identity_status: Freeclimb::SMSTenDLCBrandIdentityStatus::SELF_DECLARED, + + create_date: "2022-07-05T15:17:05Z", ) it 'returns account_id in the form of hash' do diff --git a/spec/models/sms_ten_dlc_brand_stock_exchange_spec.rb b/spec/models/sms_ten_dlc_brand_stock_exchange_spec.rb new file mode 100644 index 00000000..455a4355 --- /dev/null +++ b/spec/models/sms_ten_dlc_brand_stock_exchange_spec.rb @@ -0,0 +1,461 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::SMSTenDLCBrandStockExchange +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::SMSTenDLCBrandStockExchange do + let(:instance) { Freeclimb::SMSTenDLCBrandStockExchange.new } + + describe 'test an instance of SMSTenDLCBrandStockExchange' do + it 'should create an instance of SMSTenDLCBrandStockExchange' do + expect(instance).to be_instance_of(Freeclimb::SMSTenDLCBrandStockExchange) + end + end + + describe 'test attribute "NONE"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::NONE = "NONE" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::NONE + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("NONE") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "NONE" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::NONE + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "NASDAQ"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::NASDAQ = "NASDAQ" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::NASDAQ + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("NASDAQ") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "NASDAQ" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::NASDAQ + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "NYSE"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::NYSE = "NYSE" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::NYSE + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("NYSE") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "NYSE" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::NYSE + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "AMEX"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::AMEX = "AMEX" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::AMEX + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("AMEX") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "AMEX" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::AMEX + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "AMX"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::AMX = "AMX" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::AMX + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("AMX") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "AMX" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::AMX + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "ASX"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::ASX = "ASX" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::ASX + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("ASX") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "ASX" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::ASX + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "B3"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::B3 = "B3" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::B3 + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("B3") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "B3" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::B3 + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "BME"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::BME = "BME" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::BME + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("BME") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "BME" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::BME + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "BSE"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::BSE = "BSE" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::BSE + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("BSE") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "BSE" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::BSE + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "FRA"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::FRA = "FRA" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::FRA + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("FRA") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "FRA" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::FRA + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "ICEX"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::ICEX = "ICEX" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::ICEX + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("ICEX") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "ICEX" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::ICEX + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "JPX"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::JPX = "JPX" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::JPX + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("JPX") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "JPX" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::JPX + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "JSE"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::JSE = "JSE" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::JSE + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("JSE") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "JSE" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::JSE + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "KRX"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::KRX = "KRX" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::KRX + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("KRX") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "KRX" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::KRX + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "LON"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::LON = "LON" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::LON + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("LON") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "LON" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::LON + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "NSE"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::NSE = "NSE" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::NSE + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("NSE") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "NSE" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::NSE + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "OMX"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::OMX = "OMX" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::OMX + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("OMX") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "OMX" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::OMX + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "SEHK"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::SEHK = "SEHK" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::SEHK + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("SEHK") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "SEHK" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::SEHK + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "SGX"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::SGX = "SGX" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::SGX + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("SGX") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "SGX" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::SGX + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "SSE"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::SSE = "SSE" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::SSE + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("SSE") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "SSE" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::SSE + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "STO"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::STO = "STO" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::STO + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("STO") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "STO" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::STO + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "SWX"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::SWX = "SWX" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::SWX + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("SWX") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "SWX" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::SWX + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "SZSE"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::SZSE = "SZSE" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::SZSE + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("SZSE") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "SZSE" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::SZSE + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "TSX"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::TSX = "TSX" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::TSX + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("TSX") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "TSX" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::TSX + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "TWSE"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::TWSE = "TWSE" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::TWSE + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("TWSE") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "TWSE" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::TWSE + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "VSE"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::VSE = "VSE" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::VSE + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("VSE") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "VSE" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::VSE + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "OTHER"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCBrandStockExchange::OTHER = "OTHER" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCBrandStockExchange::OTHER + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::build_from_hash("OTHER") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "OTHER" + calculatedValue = Freeclimb::SMSTenDLCBrandStockExchange::OTHER + expect(expectedValue).to eq(calculatedValue) + end + end + +end diff --git a/spec/models/sms_ten_dlc_brands_list_result_spec.rb b/spec/models/sms_ten_dlc_brands_list_result_spec.rb index b8d2e3eb..9828779c 100644 --- a/spec/models/sms_ten_dlc_brands_list_result_spec.rb +++ b/spec/models/sms_ten_dlc_brands_list_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,42 +104,66 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::SMSTenDLCBrandsListResult.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - brands: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::SMSTenDLCBrandsListResult.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + brands: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::SMSTenDLCBrandsListResult' do - expect{instance = Freeclimb::SMSTenDLCBrandsListResult.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - brands: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SMSTenDLCBrandsListResult.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + brands: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::SMSTenDLCBrandsListResult.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - brands: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SMSTenDLCBrandsListResult.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + brands: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -147,13 +171,21 @@ it 'checks if properties are valid' do instance = Freeclimb::SMSTenDLCBrandsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -173,25 +205,39 @@ obj = Object.new() instance_1 = Freeclimb::SMSTenDLCBrandsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - brands: Freeclimb::SMSTenDLCBrand.new(), + brands: [], + ) instance_2 = Freeclimb::SMSTenDLCBrandsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - brands: Freeclimb::SMSTenDLCBrand.new(), + brands: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,25 +245,39 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::SMSTenDLCBrandsListResult.new( total: 2, + start: 2, + _end: 2, + page: 2, + num_pages: 2, + page_size: 2, + next_page_uri: "TS", - brands: Freeclimb::SMSTenDLCBrand.new(), + brands: [], + ) instance_2 = Freeclimb::SMSTenDLCBrandsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "ST", - brands: Freeclimb::SMSTenDLCBrand.new(), + brands: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -227,15 +287,23 @@ it 'calculates hash code' do instance = Freeclimb::SMSTenDLCBrandsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -243,15 +311,41 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::SMSTenDLCBrandsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) - instance_2 = Freeclimb::SMSTenDLCBrandsListResult.new + instance_2 = Freeclimb::SMSTenDLCBrandsListResult.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + brands: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -259,13 +353,21 @@ describe 'test method "_deserialize"' do instance = Freeclimb::SMSTenDLCBrandsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) it 'deserializes the data of total' do expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) @@ -297,13 +399,21 @@ it 'returns the string representation of the object' do instance = Freeclimb::SMSTenDLCBrandsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -313,13 +423,21 @@ it 'returns the object in the form of hash' do instance = Freeclimb::SMSTenDLCBrandsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -327,23 +445,39 @@ obj = Object.new() instance_1 = Freeclimb::SMSTenDLCBrandsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) instance_2 = Freeclimb::SMSTenDLCBrandsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -352,20 +486,28 @@ describe 'test method "_to_hash"' do instance = Freeclimb::SMSTenDLCBrandsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) it 'returns total in the form of hash' do expect(instance._to_hash(instance.total)).to eq(instance.total) diff --git a/spec/models/sms_ten_dlc_campaign_spec.rb b/spec/models/sms_ten_dlc_campaign_spec.rb index 2d8e06f8..9f0d96fb 100644 --- a/spec/models/sms_ten_dlc_campaign_spec.rb +++ b/spec/models/sms_ten_dlc_campaign_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -56,29 +56,21 @@ expect(instance.reseller_id).to eq("T" * 8) end it 'should not assign a value over maxLength' do - expect{instance.reseller_id = "T" * (8 + 1)}.to raise_error(ArgumentError) + expect { instance.reseller_id = "T" * (8 + 1) }.to raise_error(ArgumentError) end end describe 'test attribute "status"' do - it 'assigns value ACTIVE' do - instance.status = "ACTIVE" - expect(instance.status).to eq("ACTIVE") + instance.status = Freeclimb::SMSTenDLCCampaignStatus::ACTIVE + expect(instance.status).to eq(Freeclimb::SMSTenDLCCampaignStatus::ACTIVE) end - it 'assigns value EXPIRED' do - instance.status = "EXPIRED" - expect(instance.status).to eq("EXPIRED") - end - - it 'throws error on invalid enum' do - instance = Freeclimb::SMSTenDLCCampaign.new - expect{instance.status = "INVALID_ENUM"}.to raise_error(ArgumentError) + instance.status = Freeclimb::SMSTenDLCCampaignStatus::EXPIRED + expect(instance.status).to eq(Freeclimb::SMSTenDLCCampaignStatus::EXPIRED) end end - describe 'test attribute "create_date"' do it 'should work' do instance.create_date = "2022-07-05T15:17:05Z" @@ -109,7 +101,7 @@ expect(instance.brand_id).to eq("T" * 8) end it 'should not assign a value over maxLength' do - expect{instance.brand_id = "T" * (8 + 1)}.to raise_error(ArgumentError) + expect { instance.brand_id = "T" * (8 + 1) }.to raise_error(ArgumentError) end end @@ -119,7 +111,7 @@ expect(instance.usecase).to eq("T" * 20) end it 'should not assign a value over maxLength' do - expect{instance.usecase = "T" * (20 + 1)}.to raise_error(ArgumentError) + expect { instance.usecase = "T" * (20 + 1) }.to raise_error(ArgumentError) end end @@ -137,7 +129,7 @@ expect(instance.description).to eq("T" * 4096) end it 'should not assign a value over maxLength' do - expect{instance.description = "T" * (4096 + 1)}.to raise_error(ArgumentError) + expect { instance.description = "T" * (4096 + 1) }.to raise_error(ArgumentError) end end @@ -219,7 +211,7 @@ expect(instance.sample1).to eq("T" * 1024) end it 'should not assign a value over maxLength' do - expect{instance.sample1 = "T" * (1024 + 1)}.to raise_error(ArgumentError) + expect { instance.sample1 = "T" * (1024 + 1) }.to raise_error(ArgumentError) end end @@ -229,7 +221,7 @@ expect(instance.sample2).to eq("T" * 1024) end it 'should not assign a value over maxLength' do - expect{instance.sample2 = "T" * (1024 + 1)}.to raise_error(ArgumentError) + expect { instance.sample2 = "T" * (1024 + 1) }.to raise_error(ArgumentError) end end @@ -239,7 +231,7 @@ expect(instance.sample3).to eq("T" * 1024) end it 'should not assign a value over maxLength' do - expect{instance.sample3 = "T" * (1024 + 1)}.to raise_error(ArgumentError) + expect { instance.sample3 = "T" * (1024 + 1) }.to raise_error(ArgumentError) end end @@ -249,7 +241,7 @@ expect(instance.sample4).to eq("T" * 1024) end it 'should not assign a value over maxLength' do - expect{instance.sample4 = "T" * (1024 + 1)}.to raise_error(ArgumentError) + expect { instance.sample4 = "T" * (1024 + 1) }.to raise_error(ArgumentError) end end @@ -259,7 +251,7 @@ expect(instance.sample5).to eq("T" * 1024) end it 'should not assign a value over maxLength' do - expect{instance.sample5 = "T" * (1024 + 1)}.to raise_error(ArgumentError) + expect { instance.sample5 = "T" * (1024 + 1) }.to raise_error(ArgumentError) end end @@ -269,7 +261,7 @@ expect(instance.message_flow).to eq("T" * 2048) end it 'should not assign a value over maxLength' do - expect{instance.message_flow = "T" * (2048 + 1)}.to raise_error(ArgumentError) + expect { instance.message_flow = "T" * (2048 + 1) }.to raise_error(ArgumentError) end end @@ -279,7 +271,7 @@ expect(instance.help_message).to eq("T" * 255) end it 'should not assign a value over maxLength' do - expect{instance.help_message = "T" * (255 + 1)}.to raise_error(ArgumentError) + expect { instance.help_message = "T" * (255 + 1) }.to raise_error(ArgumentError) end end @@ -289,7 +281,7 @@ expect(instance.optin_keywords).to eq("T" * 255) end it 'should not assign a value over maxLength' do - expect{instance.optin_keywords = "T" * (255 + 1)}.to raise_error(ArgumentError) + expect { instance.optin_keywords = "T" * (255 + 1) }.to raise_error(ArgumentError) end end @@ -299,7 +291,7 @@ expect(instance.optout_keywords).to eq("T" * 255) end it 'should not assign a value over maxLength' do - expect{instance.optout_keywords = "T" * (255 + 1)}.to raise_error(ArgumentError) + expect { instance.optout_keywords = "T" * (255 + 1) }.to raise_error(ArgumentError) end end @@ -309,7 +301,7 @@ expect(instance.help_keywords).to eq("T" * 255) end it 'should not assign a value over maxLength' do - expect{instance.help_keywords = "T" * (255 + 1)}.to raise_error(ArgumentError) + expect { instance.help_keywords = "T" * (255 + 1) }.to raise_error(ArgumentError) end end @@ -319,7 +311,7 @@ expect(instance.optin_message).to eq("T" * 255) end it 'should not assign a value over maxLength' do - expect{instance.optin_message = "T" * (255 + 1)}.to raise_error(ArgumentError) + expect { instance.optin_message = "T" * (255 + 1) }.to raise_error(ArgumentError) end end @@ -329,7 +321,7 @@ expect(instance.optout_message).to eq("T" * 255) end it 'should not assign a value over maxLength' do - expect{instance.optout_message = "T" * (255 + 1)}.to raise_error(ArgumentError) + expect { instance.optout_message = "T" * (255 + 1) }.to raise_error(ArgumentError) end end @@ -339,7 +331,7 @@ expect(instance.reference_id).to eq("T" * 50) end it 'should not assign a value over maxLength' do - expect{instance.reference_id = "T" * (50 + 1)}.to raise_error(ArgumentError) + expect { instance.reference_id = "T" * (50 + 1) }.to raise_error(ArgumentError) end end @@ -361,126 +353,237 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::SMSTenDLCCampaign.new( - account_id: "TS", - campaign_id: "TS", - csp_id: "TS", - reseller_id: "TS", - status:"ACTIVE", - create_date: "2022-07-05T15:17:05Z", - auto_renewal: true, - billed_date: "2022-07-05T15:17:05Z", - brand_id: "TS", - usecase: "TS", - sub_usecases: Array.new(), - description: "TS", - embedded_link: true, - embedded_phone: true, - affiliate_marketing: true, - number_pool: true, - age_gated: true, - direct_lending: true, - subscriber_optin: true, - subscriber_optout: true, - subscriber_help: true, - sample1: "TS", - sample2: "TS", - sample3: "TS", - sample4: "TS", - sample5: "TS", - message_flow: "TS", - help_message: "TS", - optin_keywords: "TS", - optout_keywords: "TS", - help_keywords: "TS", - optin_message: "TS", - optout_message: "TS", - reference_id: "TS", - mock: true, - next_renewal_or_expiration_date: "2000-01-01", - )}.not_to raise_error() + expect { instance = Freeclimb::SMSTenDLCCampaign.new( + account_id: "TS", + + campaign_id: "TS", + + csp_id: "TS", + + reseller_id: "TS", + + + status: Freeclimb::SMSTenDLCCampaignStatus::ACTIVE, + + + create_date: "2022-07-05T15:17:05Z", + auto_renewal: true, + + + billed_date: "2022-07-05T15:17:05Z", + brand_id: "TS", + + usecase: "TS", + + sub_usecases: Array.new(), + + description: "TS", + + embedded_link: true, + + embedded_phone: true, + + affiliate_marketing: true, + + number_pool: true, + + age_gated: true, + + direct_lending: true, + + subscriber_optin: true, + + subscriber_optout: true, + + subscriber_help: true, + + sample1: "TS", + + sample2: "TS", + + sample3: "TS", + + sample4: "TS", + + sample5: "TS", + + message_flow: "TS", + + help_message: "TS", + + optin_keywords: "TS", + + optout_keywords: "TS", + + help_keywords: "TS", + + optin_message: "TS", + + optout_message: "TS", + + reference_id: "TS", + + mock: true, + + + next_renewal_or_expiration_date: "2000-01-01", + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::SMSTenDLCCampaign' do - expect{instance = Freeclimb::SMSTenDLCCampaign.new( - account_id: "TS", - campaign_id: "TS", - csp_id: "TS", - reseller_id: "TS", - status:"ACTIVE", - create_date: "2022-07-05T15:17:05Z", - auto_renewal: true, - billed_date: "2022-07-05T15:17:05Z", - brand_id: "TS", - usecase: "TS", - sub_usecases: Array.new(), - description: "TS", - embedded_link: true, - embedded_phone: true, - affiliate_marketing: true, - number_pool: true, - age_gated: true, - direct_lending: true, - subscriber_optin: true, - subscriber_optout: true, - subscriber_help: true, - sample1: "TS", - sample2: "TS", - sample3: "TS", - sample4: "TS", - sample5: "TS", - message_flow: "TS", - help_message: "TS", - optin_keywords: "TS", - optout_keywords: "TS", - help_keywords: "TS", - optin_message: "TS", - optout_message: "TS", - reference_id: "TS", - mock: true, - next_renewal_or_expiration_date: "2000-01-01", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SMSTenDLCCampaign.new( + account_id: "TS", + + campaign_id: "TS", + + csp_id: "TS", + + reseller_id: "TS", + + + status: Freeclimb::SMSTenDLCCampaignStatus::ACTIVE, + + + create_date: "2022-07-05T15:17:05Z", + auto_renewal: true, + + + billed_date: "2022-07-05T15:17:05Z", + brand_id: "TS", + + usecase: "TS", + + sub_usecases: Array.new(), + + description: "TS", + + embedded_link: true, + + embedded_phone: true, + + affiliate_marketing: true, + + number_pool: true, + + age_gated: true, + + direct_lending: true, + + subscriber_optin: true, + + subscriber_optout: true, + + subscriber_help: true, + + sample1: "TS", + + sample2: "TS", + + sample3: "TS", + + sample4: "TS", + + sample5: "TS", + + message_flow: "TS", + + help_message: "TS", + + optin_keywords: "TS", + + optout_keywords: "TS", + + help_keywords: "TS", + + optin_message: "TS", + + optout_message: "TS", + + reference_id: "TS", + + mock: true, + + + next_renewal_or_expiration_date: "2000-01-01", + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::SMSTenDLCCampaign.new( - account_id: "TS", - campaign_id: "TS", - csp_id: "TS", - reseller_id: "TS", - status:"ACTIVE", - create_date: "2022-07-05T15:17:05Z", - auto_renewal: true, - billed_date: "2022-07-05T15:17:05Z", - brand_id: "TS", - usecase: "TS", - sub_usecases: Array.new(), - description: "TS", - embedded_link: true, - embedded_phone: true, - affiliate_marketing: true, - number_pool: true, - age_gated: true, - direct_lending: true, - subscriber_optin: true, - subscriber_optout: true, - subscriber_help: true, - sample1: "TS", - sample2: "TS", - sample3: "TS", - sample4: "TS", - sample5: "TS", - message_flow: "TS", - help_message: "TS", - optin_keywords: "TS", - optout_keywords: "TS", - help_keywords: "TS", - optin_message: "TS", - optout_message: "TS", - reference_id: "TS", - mock: true, - next_renewal_or_expiration_date: "2000-01-01", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SMSTenDLCCampaign.new( + account_id: "TS", + + campaign_id: "TS", + + csp_id: "TS", + + reseller_id: "TS", + + + status: Freeclimb::SMSTenDLCCampaignStatus::ACTIVE, + + + create_date: "2022-07-05T15:17:05Z", + auto_renewal: true, + + + billed_date: "2022-07-05T15:17:05Z", + brand_id: "TS", + + usecase: "TS", + + sub_usecases: Array.new(), + + description: "TS", + + embedded_link: true, + + embedded_phone: true, + + affiliate_marketing: true, + + number_pool: true, + + age_gated: true, + + direct_lending: true, + + subscriber_optin: true, + + subscriber_optout: true, + + subscriber_help: true, + + sample1: "TS", + + sample2: "TS", + + sample3: "TS", + + sample4: "TS", + + sample5: "TS", + + message_flow: "TS", + + help_message: "TS", + + optin_keywords: "TS", + + optout_keywords: "TS", + + help_keywords: "TS", + + optin_message: "TS", + + optout_message: "TS", + + reference_id: "TS", + + mock: true, + + + next_renewal_or_expiration_date: "2000-01-01", + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -488,40 +591,77 @@ it 'checks if properties are valid' do instance = Freeclimb::SMSTenDLCCampaign.new( account_id: "TS", + campaign_id: "TS", + csp_id: "TS", + reseller_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", auto_renewal: true, + + billed_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + sub_usecases: Array.new(), + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + reference_id: "TS", + mock: true, + + next_renewal_or_expiration_date: "2000-01-01", ) expect(instance.valid?).to eq(true) @@ -542,73 +682,147 @@ obj = Object.new() instance_1 = Freeclimb::SMSTenDLCCampaign.new( account_id: "TS", + campaign_id: "TS", + csp_id: "TS", + reseller_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCCampaignStatus::ACTIVE, + + auto_renewal: true, + + brand_id: "TS", + usecase: "TS", + sub_usecases: [], + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + reference_id: "TS", + mock: true, + + ) instance_2 = Freeclimb::SMSTenDLCCampaign.new( account_id: "TS", + campaign_id: "TS", + csp_id: "TS", + reseller_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCCampaignStatus::ACTIVE, + + auto_renewal: true, + + brand_id: "TS", + usecase: "TS", + sub_usecases: [], + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + reference_id: "TS", + mock: true, + + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -616,73 +830,147 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::SMSTenDLCCampaign.new( account_id: "TS", + campaign_id: "TS", + csp_id: "TS", + reseller_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCCampaignStatus::ACTIVE, + + auto_renewal: true, + + brand_id: "TS", + usecase: "TS", + sub_usecases: [], + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + reference_id: "TS", + mock: true, + + ) instance_2 = Freeclimb::SMSTenDLCCampaign.new( account_id: "ST", + campaign_id: "ST", + csp_id: "ST", + reseller_id: "ST", - status:"ACTIVE", + + + status: nil, + + auto_renewal: false, + + brand_id: "ST", + usecase: "ST", + sub_usecases: nil, + description: "ST", + embedded_link: false, + embedded_phone: false, + affiliate_marketing: false, + number_pool: false, + age_gated: false, + direct_lending: false, + subscriber_optin: false, + subscriber_optout: false, + subscriber_help: false, + sample1: "ST", + sample2: "ST", + sample3: "ST", + sample4: "ST", + sample5: "ST", + message_flow: "ST", + help_message: "ST", + optin_keywords: "ST", + optout_keywords: "ST", + help_keywords: "ST", + optin_message: "ST", + optout_message: "ST", + reference_id: "ST", + mock: false, + + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -692,43 +980,80 @@ it 'calculates hash code' do instance = Freeclimb::SMSTenDLCCampaign.new( account_id: "TS", + campaign_id: "TS", + csp_id: "TS", + reseller_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", auto_renewal: true, + + billed_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + sub_usecases: Array.new(), + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + reference_id: "TS", + mock: true, + + next_renewal_or_expiration_date: "2000-01-01", ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -736,43 +1061,155 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::SMSTenDLCCampaign.new( account_id: "TS", + + campaign_id: "TS", + + csp_id: "TS", + + reseller_id: "TS", + + + status: Freeclimb::SMSTenDLCCampaignStatus::ACTIVE, + + + create_date: "2022-07-05T15:17:05Z", + auto_renewal: true, + + + billed_date: "2022-07-05T15:17:05Z", + brand_id: "TS", + + usecase: "TS", + + sub_usecases: Array.new(), + + description: "TS", + + embedded_link: true, + + embedded_phone: true, + + affiliate_marketing: true, + + number_pool: true, + + age_gated: true, + + direct_lending: true, + + subscriber_optin: true, + + subscriber_optout: true, + + subscriber_help: true, + + sample1: "TS", + + sample2: "TS", + + sample3: "TS", + + sample4: "TS", + + sample5: "TS", + + message_flow: "TS", + + help_message: "TS", + + optin_keywords: "TS", + + optout_keywords: "TS", + + help_keywords: "TS", + + optin_message: "TS", + + optout_message: "TS", + + reference_id: "TS", + + mock: true, + + + next_renewal_or_expiration_date: "2000-01-01", + ) + instance_2 = Freeclimb::SMSTenDLCCampaign.new( + account_id: "TS", + campaign_id: "TS", + csp_id: "TS", + reseller_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", auto_renewal: true, + + billed_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + sub_usecases: Array.new(), + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + reference_id: "TS", + mock: true, + + next_renewal_or_expiration_date: "2000-01-01", ) - instance_2 = Freeclimb::SMSTenDLCCampaign.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -780,40 +1217,77 @@ describe 'test method "_deserialize"' do instance = Freeclimb::SMSTenDLCCampaign.new( account_id: "TS", + campaign_id: "TS", + csp_id: "TS", + reseller_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", auto_renewal: true, + + billed_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + sub_usecases: Array.new(), + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + reference_id: "TS", + mock: true, + + next_renewal_or_expiration_date: "2000-01-01", ) it 'deserializes the data of account_id' do @@ -828,9 +1302,6 @@ it 'deserializes the data of reseller_id' do expect(instance._deserialize("String", instance.reseller_id)).to be_a_kind_of(String) end - it 'deserializes the data of status' do - expect(instance._deserialize("String", instance.status)).to be_a_kind_of(String) - end it 'deserializes the data of create_date' do expect(instance._deserialize("Time", instance.create_date)).to be_a_kind_of(Time) end @@ -930,40 +1401,77 @@ it 'returns the string representation of the object' do instance = Freeclimb::SMSTenDLCCampaign.new( account_id: "TS", + campaign_id: "TS", + csp_id: "TS", + reseller_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", auto_renewal: true, + + billed_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + sub_usecases: Array.new(), + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + reference_id: "TS", + mock: true, + + next_renewal_or_expiration_date: "2000-01-01", ) expect(instance.to_s).to eq(instance.to_hash.to_s) @@ -974,40 +1482,77 @@ it 'returns the object in the form of hash' do instance = Freeclimb::SMSTenDLCCampaign.new( account_id: "TS", + campaign_id: "TS", + csp_id: "TS", + reseller_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", auto_renewal: true, + + billed_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + sub_usecases: Array.new(), + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + reference_id: "TS", + mock: true, + + next_renewal_or_expiration_date: "2000-01-01", ) expect(instance.to_hash).to be_a_kind_of(Hash) @@ -1016,78 +1561,152 @@ obj = Object.new() instance_1 = Freeclimb::SMSTenDLCCampaign.new( account_id: "TS", + campaign_id: "TS", + csp_id: "TS", + reseller_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", auto_renewal: true, + + billed_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + sub_usecases: Array.new(), + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + reference_id: "TS", + mock: true, + + next_renewal_or_expiration_date: "2000-01-01", ) instance_2 = Freeclimb::SMSTenDLCCampaign.new( account_id: "TS", + campaign_id: "TS", + csp_id: "TS", + reseller_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", auto_renewal: true, + + billed_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + sub_usecases: Array.new(), + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + reference_id: "TS", + mock: true, + + next_renewal_or_expiration_date: "2000-01-01", ) expect(instance_1.to_hash).to eq(instance_2.to_hash) @@ -1097,75 +1716,112 @@ describe 'test method "_to_hash"' do instance = Freeclimb::SMSTenDLCCampaign.new( account_id: "TS", + campaign_id: "TS", + csp_id: "TS", + reseller_id: "TS", + - status:"ACTIVE", + + status: Freeclimb::SMSTenDLCCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", auto_renewal: true, + + billed_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + sub_usecases: Array.new(), + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + reference_id: "TS", + mock: true, + + next_renewal_or_expiration_date: "2000-01-01", ) it 'returns account_id in the form of hash' do diff --git a/spec/models/sms_ten_dlc_campaign_status_spec.rb b/spec/models/sms_ten_dlc_campaign_status_spec.rb new file mode 100644 index 00000000..79e73687 --- /dev/null +++ b/spec/models/sms_ten_dlc_campaign_status_spec.rb @@ -0,0 +1,61 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::SMSTenDLCCampaignStatus +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::SMSTenDLCCampaignStatus do + let(:instance) { Freeclimb::SMSTenDLCCampaignStatus.new } + + describe 'test an instance of SMSTenDLCCampaignStatus' do + it 'should create an instance of SMSTenDLCCampaignStatus' do + expect(instance).to be_instance_of(Freeclimb::SMSTenDLCCampaignStatus) + end + end + + describe 'test attribute "ACTIVE"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCCampaignStatus::ACTIVE = "ACTIVE" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCCampaignStatus::ACTIVE + calculatedValue = Freeclimb::SMSTenDLCCampaignStatus::build_from_hash("ACTIVE") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "ACTIVE" + calculatedValue = Freeclimb::SMSTenDLCCampaignStatus::ACTIVE + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "EXPIRED"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCCampaignStatus::EXPIRED = "EXPIRED" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCCampaignStatus::EXPIRED + calculatedValue = Freeclimb::SMSTenDLCCampaignStatus::build_from_hash("EXPIRED") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "EXPIRED" + calculatedValue = Freeclimb::SMSTenDLCCampaignStatus::EXPIRED + expect(expectedValue).to eq(calculatedValue) + end + end + +end diff --git a/spec/models/sms_ten_dlc_campaigns_list_result_spec.rb b/spec/models/sms_ten_dlc_campaigns_list_result_spec.rb index 823d8194..4573dce5 100644 --- a/spec/models/sms_ten_dlc_campaigns_list_result_spec.rb +++ b/spec/models/sms_ten_dlc_campaigns_list_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,42 +104,66 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::SMSTenDLCCampaignsListResult.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - campaigns: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::SMSTenDLCCampaignsListResult.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + campaigns: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::SMSTenDLCCampaignsListResult' do - expect{instance = Freeclimb::SMSTenDLCCampaignsListResult.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - campaigns: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SMSTenDLCCampaignsListResult.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + campaigns: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::SMSTenDLCCampaignsListResult.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - campaigns: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SMSTenDLCCampaignsListResult.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + campaigns: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -147,13 +171,21 @@ it 'checks if properties are valid' do instance = Freeclimb::SMSTenDLCCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + campaigns: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -173,25 +205,39 @@ obj = Object.new() instance_1 = Freeclimb::SMSTenDLCCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - campaigns: Freeclimb::SMSTenDLCCampaign.new(), + campaigns: [], + ) instance_2 = Freeclimb::SMSTenDLCCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - campaigns: Freeclimb::SMSTenDLCCampaign.new(), + campaigns: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,25 +245,39 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::SMSTenDLCCampaignsListResult.new( total: 2, + start: 2, + _end: 2, + page: 2, + num_pages: 2, + page_size: 2, + next_page_uri: "TS", - campaigns: Freeclimb::SMSTenDLCCampaign.new(), + campaigns: [], + ) instance_2 = Freeclimb::SMSTenDLCCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "ST", - campaigns: Freeclimb::SMSTenDLCCampaign.new(), + campaigns: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -227,15 +287,23 @@ it 'calculates hash code' do instance = Freeclimb::SMSTenDLCCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + campaigns: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -243,15 +311,41 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::SMSTenDLCCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + campaigns: Array.new(), + ) - instance_2 = Freeclimb::SMSTenDLCCampaignsListResult.new + instance_2 = Freeclimb::SMSTenDLCCampaignsListResult.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + campaigns: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -259,13 +353,21 @@ describe 'test method "_deserialize"' do instance = Freeclimb::SMSTenDLCCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + campaigns: Array.new(), + ) it 'deserializes the data of total' do expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) @@ -297,13 +399,21 @@ it 'returns the string representation of the object' do instance = Freeclimb::SMSTenDLCCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + campaigns: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -313,13 +423,21 @@ it 'returns the object in the form of hash' do instance = Freeclimb::SMSTenDLCCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + campaigns: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -327,23 +445,39 @@ obj = Object.new() instance_1 = Freeclimb::SMSTenDLCCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + campaigns: Array.new(), + ) instance_2 = Freeclimb::SMSTenDLCCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + campaigns: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -352,20 +486,28 @@ describe 'test method "_to_hash"' do instance = Freeclimb::SMSTenDLCCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + campaigns: Array.new(), + ) it 'returns total in the form of hash' do expect(instance._to_hash(instance.total)).to eq(instance.total) diff --git a/spec/models/sms_ten_dlc_partner_campaign_brand_spec.rb b/spec/models/sms_ten_dlc_partner_campaign_brand_spec.rb index ea092456..5ec15f9c 100644 --- a/spec/models/sms_ten_dlc_partner_campaign_brand_spec.rb +++ b/spec/models/sms_ten_dlc_partner_campaign_brand_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -48,7 +48,7 @@ expect(instance.first_name).to eq("T" * 100) end it 'should not assign a value over maxLength' do - expect{instance.first_name = "T" * (100 + 1)}.to raise_error(ArgumentError) + expect { instance.first_name = "T" * (100 + 1) }.to raise_error(ArgumentError) end end @@ -58,7 +58,7 @@ expect(instance.last_name).to eq("T" * 100) end it 'should not assign a value over maxLength' do - expect{instance.last_name = "T" * (100 + 1)}.to raise_error(ArgumentError) + expect { instance.last_name = "T" * (100 + 1) }.to raise_error(ArgumentError) end end @@ -68,7 +68,7 @@ expect(instance.display_name).to eq("T" * 255) end it 'should not assign a value over maxLength' do - expect{instance.display_name = "T" * (255 + 1)}.to raise_error(ArgumentError) + expect { instance.display_name = "T" * (255 + 1) }.to raise_error(ArgumentError) end end @@ -78,7 +78,7 @@ expect(instance.company_name).to eq("T" * 255) end it 'should not assign a value over maxLength' do - expect{instance.company_name = "T" * (255 + 1)}.to raise_error(ArgumentError) + expect { instance.company_name = "T" * (255 + 1) }.to raise_error(ArgumentError) end end @@ -88,7 +88,7 @@ expect(instance.phone).to eq("T" * 20) end it 'should not assign a value over maxLength' do - expect{instance.phone = "T" * (20 + 1)}.to raise_error(ArgumentError) + expect { instance.phone = "T" * (20 + 1) }.to raise_error(ArgumentError) end end @@ -98,7 +98,7 @@ expect(instance.email).to eq("T" * 100) end it 'should not assign a value over maxLength' do - expect{instance.email = "T" * (100 + 1)}.to raise_error(ArgumentError) + expect { instance.email = "T" * (100 + 1) }.to raise_error(ArgumentError) end end @@ -108,7 +108,7 @@ expect(instance.website).to eq("T" * 100) end it 'should not assign a value over maxLength' do - expect{instance.website = "T" * (100 + 1)}.to raise_error(ArgumentError) + expect { instance.website = "T" * (100 + 1) }.to raise_error(ArgumentError) end end @@ -133,51 +133,84 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( - account_id: "TS", - brand_id: "TS", - first_name: "TS", - last_name: "TS", - display_name: "TS", - company_name: "TS", - phone: "TS", - email: "TS", - website: "TS", - optional_attributes: Hash.new(), - evp_vetting_score: 1, - )}.not_to raise_error() + expect { instance = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( + account_id: "TS", + + brand_id: "TS", + + first_name: "TS", + + last_name: "TS", + + display_name: "TS", + + company_name: "TS", + + phone: "TS", + + email: "TS", + + website: "TS", + + optional_attributes: Hash.new(), + + evp_vetting_score: 1, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::SMSTenDLCPartnerCampaignBrand' do - expect{instance = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( - account_id: "TS", - brand_id: "TS", - first_name: "TS", - last_name: "TS", - display_name: "TS", - company_name: "TS", - phone: "TS", - email: "TS", - website: "TS", - optional_attributes: Hash.new(), - evp_vetting_score: 1, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( + account_id: "TS", + + brand_id: "TS", + + first_name: "TS", + + last_name: "TS", + + display_name: "TS", + + company_name: "TS", + + phone: "TS", + + email: "TS", + + website: "TS", + + optional_attributes: Hash.new(), + + evp_vetting_score: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( - account_id: "TS", - brand_id: "TS", - first_name: "TS", - last_name: "TS", - display_name: "TS", - company_name: "TS", - phone: "TS", - email: "TS", - website: "TS", - optional_attributes: Hash.new(), - evp_vetting_score: 1, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( + account_id: "TS", + + brand_id: "TS", + + first_name: "TS", + + last_name: "TS", + + display_name: "TS", + + company_name: "TS", + + phone: "TS", + + email: "TS", + + website: "TS", + + optional_attributes: Hash.new(), + + evp_vetting_score: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -185,16 +218,27 @@ it 'checks if properties are valid' do instance = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( account_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + phone: "TS", + email: "TS", + website: "TS", + optional_attributes: Hash.new(), + evp_vetting_score: 1, + ) expect(instance.valid?).to eq(true) end @@ -214,27 +258,49 @@ obj = Object.new() instance_1 = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( account_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + phone: "TS", + email: "TS", + website: "TS", + + evp_vetting_score: 1, + ) instance_2 = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( account_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + phone: "TS", + email: "TS", + website: "TS", + + evp_vetting_score: 1, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -242,27 +308,49 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( account_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + phone: "TS", + email: "TS", + website: "TS", + + evp_vetting_score: 2, + ) instance_2 = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( account_id: "ST", + brand_id: "ST", + first_name: "ST", + last_name: "ST", + display_name: "ST", + company_name: "ST", + phone: "ST", + email: "ST", + website: "ST", + + evp_vetting_score: 1, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -272,18 +360,29 @@ it 'calculates hash code' do instance = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( account_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + phone: "TS", + email: "TS", + website: "TS", + optional_attributes: Hash.new(), + evp_vetting_score: 1, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -291,18 +390,53 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( account_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + phone: "TS", + email: "TS", + website: "TS", + optional_attributes: Hash.new(), + evp_vetting_score: 1, + ) - instance_2 = Freeclimb::SMSTenDLCPartnerCampaignBrand.new + instance_2 = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( + account_id: "TS", + + brand_id: "TS", + + first_name: "TS", + + last_name: "TS", + + display_name: "TS", + + company_name: "TS", + + phone: "TS", + + email: "TS", + + website: "TS", + + optional_attributes: Hash.new(), + + evp_vetting_score: 1, + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -310,16 +444,27 @@ describe 'test method "_deserialize"' do instance = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( account_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + phone: "TS", + email: "TS", + website: "TS", + optional_attributes: Hash.new(), + evp_vetting_score: 1, + ) it 'deserializes the data of account_id' do expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) @@ -360,16 +505,27 @@ it 'returns the string representation of the object' do instance = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( account_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + phone: "TS", + email: "TS", + website: "TS", + optional_attributes: Hash.new(), + evp_vetting_score: 1, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -379,16 +535,27 @@ it 'returns the object in the form of hash' do instance = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( account_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + phone: "TS", + email: "TS", + website: "TS", + optional_attributes: Hash.new(), + evp_vetting_score: 1, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -396,29 +563,51 @@ obj = Object.new() instance_1 = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( account_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + phone: "TS", + email: "TS", + website: "TS", + optional_attributes: Hash.new(), + evp_vetting_score: 1, + ) instance_2 = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( account_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + phone: "TS", + email: "TS", + website: "TS", + optional_attributes: Hash.new(), + evp_vetting_score: 1, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -427,26 +616,37 @@ describe 'test method "_to_hash"' do instance = Freeclimb::SMSTenDLCPartnerCampaignBrand.new( account_id: "TS", + brand_id: "TS", + first_name: "TS", + last_name: "TS", + display_name: "TS", + company_name: "TS", + phone: "TS", + email: "TS", + website: "TS", + optional_attributes: Hash.new(), + evp_vetting_score: 1, + ) it 'returns account_id in the form of hash' do expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) diff --git a/spec/models/sms_ten_dlc_partner_campaign_spec.rb b/spec/models/sms_ten_dlc_partner_campaign_spec.rb index d5ca1282..d0c5aa81 100644 --- a/spec/models/sms_ten_dlc_partner_campaign_spec.rb +++ b/spec/models/sms_ten_dlc_partner_campaign_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -44,23 +44,15 @@ describe 'test attribute "status"' do - it 'assigns value ACTIVE' do - instance.status = "ACTIVE" - expect(instance.status).to eq("ACTIVE") + instance.status = Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE + expect(instance.status).to eq(Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE) end - it 'assigns value EXPIRED' do - instance.status = "EXPIRED" - expect(instance.status).to eq("EXPIRED") - end - - it 'throws error on invalid enum' do - instance = Freeclimb::SMSTenDLCPartnerCampaign.new - expect{instance.status = "INVALID_ENUM"}.to raise_error(ArgumentError) + instance.status = Freeclimb::SMSTenDLCPartnerCampaignStatus::EXPIRED + expect(instance.status).to eq(Freeclimb::SMSTenDLCPartnerCampaignStatus::EXPIRED) end end - describe 'test attribute "create_date"' do it 'should work' do instance.create_date = "2022-07-05T15:17:05Z" @@ -75,7 +67,7 @@ expect(instance.brand_id).to eq("T" * 8) end it 'should not assign a value over maxLength' do - expect{instance.brand_id = "T" * (8 + 1)}.to raise_error(ArgumentError) + expect { instance.brand_id = "T" * (8 + 1) }.to raise_error(ArgumentError) end end @@ -85,7 +77,7 @@ expect(instance.usecase).to eq("T" * 20) end it 'should not assign a value over maxLength' do - expect{instance.usecase = "T" * (20 + 1)}.to raise_error(ArgumentError) + expect { instance.usecase = "T" * (20 + 1) }.to raise_error(ArgumentError) end end @@ -95,7 +87,7 @@ expect(instance.description).to eq("T" * 4096) end it 'should not assign a value over maxLength' do - expect{instance.description = "T" * (4096 + 1)}.to raise_error(ArgumentError) + expect { instance.description = "T" * (4096 + 1) }.to raise_error(ArgumentError) end end @@ -177,7 +169,7 @@ expect(instance.sample1).to eq("T" * 1024) end it 'should not assign a value over maxLength' do - expect{instance.sample1 = "T" * (1024 + 1)}.to raise_error(ArgumentError) + expect { instance.sample1 = "T" * (1024 + 1) }.to raise_error(ArgumentError) end end @@ -187,7 +179,7 @@ expect(instance.sample2).to eq("T" * 1024) end it 'should not assign a value over maxLength' do - expect{instance.sample2 = "T" * (1024 + 1)}.to raise_error(ArgumentError) + expect { instance.sample2 = "T" * (1024 + 1) }.to raise_error(ArgumentError) end end @@ -197,7 +189,7 @@ expect(instance.sample3).to eq("T" * 1024) end it 'should not assign a value over maxLength' do - expect{instance.sample3 = "T" * (1024 + 1)}.to raise_error(ArgumentError) + expect { instance.sample3 = "T" * (1024 + 1) }.to raise_error(ArgumentError) end end @@ -207,7 +199,7 @@ expect(instance.sample4).to eq("T" * 1024) end it 'should not assign a value over maxLength' do - expect{instance.sample4 = "T" * (1024 + 1)}.to raise_error(ArgumentError) + expect { instance.sample4 = "T" * (1024 + 1) }.to raise_error(ArgumentError) end end @@ -217,7 +209,7 @@ expect(instance.sample5).to eq("T" * 1024) end it 'should not assign a value over maxLength' do - expect{instance.sample5 = "T" * (1024 + 1)}.to raise_error(ArgumentError) + expect { instance.sample5 = "T" * (1024 + 1) }.to raise_error(ArgumentError) end end @@ -227,7 +219,7 @@ expect(instance.message_flow).to eq("T" * 2048) end it 'should not assign a value over maxLength' do - expect{instance.message_flow = "T" * (2048 + 1)}.to raise_error(ArgumentError) + expect { instance.message_flow = "T" * (2048 + 1) }.to raise_error(ArgumentError) end end @@ -237,7 +229,7 @@ expect(instance.help_message).to eq("T" * 255) end it 'should not assign a value over maxLength' do - expect{instance.help_message = "T" * (255 + 1)}.to raise_error(ArgumentError) + expect { instance.help_message = "T" * (255 + 1) }.to raise_error(ArgumentError) end end @@ -247,7 +239,7 @@ expect(instance.optin_keywords).to eq("T" * 255) end it 'should not assign a value over maxLength' do - expect{instance.optin_keywords = "T" * (255 + 1)}.to raise_error(ArgumentError) + expect { instance.optin_keywords = "T" * (255 + 1) }.to raise_error(ArgumentError) end end @@ -257,7 +249,7 @@ expect(instance.optout_keywords).to eq("T" * 255) end it 'should not assign a value over maxLength' do - expect{instance.optout_keywords = "T" * (255 + 1)}.to raise_error(ArgumentError) + expect { instance.optout_keywords = "T" * (255 + 1) }.to raise_error(ArgumentError) end end @@ -267,7 +259,7 @@ expect(instance.help_keywords).to eq("T" * 255) end it 'should not assign a value over maxLength' do - expect{instance.help_keywords = "T" * (255 + 1)}.to raise_error(ArgumentError) + expect { instance.help_keywords = "T" * (255 + 1) }.to raise_error(ArgumentError) end end @@ -277,7 +269,7 @@ expect(instance.optin_message).to eq("T" * 255) end it 'should not assign a value over maxLength' do - expect{instance.optin_message = "T" * (255 + 1)}.to raise_error(ArgumentError) + expect { instance.optin_message = "T" * (255 + 1) }.to raise_error(ArgumentError) end end @@ -287,7 +279,7 @@ expect(instance.optout_message).to eq("T" * 255) end it 'should not assign a value over maxLength' do - expect{instance.optout_message = "T" * (255 + 1)}.to raise_error(ArgumentError) + expect { instance.optout_message = "T" * (255 + 1) }.to raise_error(ArgumentError) end end @@ -301,105 +293,195 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::SMSTenDLCPartnerCampaign.new( - account_id: "TS", - campaign_id: "TS", - status:"ACTIVE", - create_date: "2022-07-05T15:17:05Z", - brand_id: "TS", - usecase: "TS", - description: "TS", - embedded_link: true, - embedded_phone: true, - affiliate_marketing: true, - number_pool: true, - age_gated: true, - direct_lending: true, - subscriber_optin: true, - subscriber_optout: true, - subscriber_help: true, - sample1: "TS", - sample2: "TS", - sample3: "TS", - sample4: "TS", - sample5: "TS", - message_flow: "TS", - help_message: "TS", - optin_keywords: "TS", - optout_keywords: "TS", - help_keywords: "TS", - optin_message: "TS", - optout_message: "TS", - brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::SMSTenDLCPartnerCampaign.new( + account_id: "TS", + + campaign_id: "TS", + + + status: Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE, + + + create_date: "2022-07-05T15:17:05Z", + brand_id: "TS", + + usecase: "TS", + + description: "TS", + + embedded_link: true, + + embedded_phone: true, + + affiliate_marketing: true, + + number_pool: true, + + age_gated: true, + + direct_lending: true, + + subscriber_optin: true, + + subscriber_optout: true, + + subscriber_help: true, + + sample1: "TS", + + sample2: "TS", + + sample3: "TS", + + sample4: "TS", + + sample5: "TS", + + message_flow: "TS", + + help_message: "TS", + + optin_keywords: "TS", + + optout_keywords: "TS", + + help_keywords: "TS", + + optin_message: "TS", + + optout_message: "TS", + + + brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new(), + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::SMSTenDLCPartnerCampaign' do - expect{instance = Freeclimb::SMSTenDLCPartnerCampaign.new( - account_id: "TS", - campaign_id: "TS", - status:"ACTIVE", - create_date: "2022-07-05T15:17:05Z", - brand_id: "TS", - usecase: "TS", - description: "TS", - embedded_link: true, - embedded_phone: true, - affiliate_marketing: true, - number_pool: true, - age_gated: true, - direct_lending: true, - subscriber_optin: true, - subscriber_optout: true, - subscriber_help: true, - sample1: "TS", - sample2: "TS", - sample3: "TS", - sample4: "TS", - sample5: "TS", - message_flow: "TS", - help_message: "TS", - optin_keywords: "TS", - optout_keywords: "TS", - help_keywords: "TS", - optin_message: "TS", - optout_message: "TS", - brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SMSTenDLCPartnerCampaign.new( + account_id: "TS", + + campaign_id: "TS", + + + status: Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE, + + + create_date: "2022-07-05T15:17:05Z", + brand_id: "TS", + + usecase: "TS", + + description: "TS", + + embedded_link: true, + + embedded_phone: true, + + affiliate_marketing: true, + + number_pool: true, + + age_gated: true, + + direct_lending: true, + + subscriber_optin: true, + + subscriber_optout: true, + + subscriber_help: true, + + sample1: "TS", + + sample2: "TS", + + sample3: "TS", + + sample4: "TS", + + sample5: "TS", + + message_flow: "TS", + + help_message: "TS", + + optin_keywords: "TS", + + optout_keywords: "TS", + + help_keywords: "TS", + + optin_message: "TS", + + optout_message: "TS", + + + brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new, + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::SMSTenDLCPartnerCampaign.new( - account_id: "TS", - campaign_id: "TS", - status:"ACTIVE", - create_date: "2022-07-05T15:17:05Z", - brand_id: "TS", - usecase: "TS", - description: "TS", - embedded_link: true, - embedded_phone: true, - affiliate_marketing: true, - number_pool: true, - age_gated: true, - direct_lending: true, - subscriber_optin: true, - subscriber_optout: true, - subscriber_help: true, - sample1: "TS", - sample2: "TS", - sample3: "TS", - sample4: "TS", - sample5: "TS", - message_flow: "TS", - help_message: "TS", - optin_keywords: "TS", - optout_keywords: "TS", - help_keywords: "TS", - optin_message: "TS", - optout_message: "TS", - brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SMSTenDLCPartnerCampaign.new( + account_id: "TS", + + campaign_id: "TS", + + + status: Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE, + + + create_date: "2022-07-05T15:17:05Z", + brand_id: "TS", + + usecase: "TS", + + description: "TS", + + embedded_link: true, + + embedded_phone: true, + + affiliate_marketing: true, + + number_pool: true, + + age_gated: true, + + direct_lending: true, + + subscriber_optin: true, + + subscriber_optout: true, + + subscriber_help: true, + + sample1: "TS", + + sample2: "TS", + + sample3: "TS", + + sample4: "TS", + + sample5: "TS", + + message_flow: "TS", + + help_message: "TS", + + optin_keywords: "TS", + + optout_keywords: "TS", + + help_keywords: "TS", + + optin_message: "TS", + + optout_message: "TS", + + + brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new, + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -407,33 +489,63 @@ it 'checks if properties are valid' do instance = Freeclimb::SMSTenDLCPartnerCampaign.new( account_id: "TS", + campaign_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + + brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new(), ) expect(instance.valid?).to eq(true) @@ -454,63 +566,123 @@ obj = Object.new() instance_1 = Freeclimb::SMSTenDLCPartnerCampaign.new( account_id: "TS", + campaign_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE, + + brand_id: "TS", + usecase: "TS", + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new(), + ) instance_2 = Freeclimb::SMSTenDLCPartnerCampaign.new( account_id: "TS", + campaign_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE, + + brand_id: "TS", + usecase: "TS", + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new(), + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -518,139 +690,320 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::SMSTenDLCPartnerCampaign.new( account_id: "TS", + campaign_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE, + + brand_id: "TS", + usecase: "TS", + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new(), + ) instance_2 = Freeclimb::SMSTenDLCPartnerCampaign.new( account_id: "ST", + campaign_id: "ST", - status:"ACTIVE", + + + status: nil, + + brand_id: "ST", + usecase: "ST", + description: "ST", + embedded_link: false, + embedded_phone: false, + affiliate_marketing: false, + number_pool: false, + age_gated: false, + direct_lending: false, + subscriber_optin: false, + subscriber_optout: false, + subscriber_help: false, + sample1: "ST", + sample2: "ST", + sample3: "ST", + sample4: "ST", + sample5: "ST", + message_flow: "ST", + help_message: "ST", + optin_keywords: "ST", + optout_keywords: "ST", + help_keywords: "ST", + optin_message: "ST", + optout_message: "ST", + brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new(), + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::SMSTenDLCPartnerCampaign.new( + account_id: "TS", + + campaign_id: "TS", + + + status: Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE, + + + create_date: "2022-07-05T15:17:05Z", + brand_id: "TS", + + usecase: "TS", + + description: "TS", + + embedded_link: true, + + embedded_phone: true, + + affiliate_marketing: true, + + number_pool: true, + + age_gated: true, + + direct_lending: true, + + subscriber_optin: true, + + subscriber_optout: true, + + subscriber_help: true, + + sample1: "TS", + + sample2: "TS", + + sample3: "TS", + + sample4: "TS", + + sample5: "TS", + + message_flow: "TS", + + help_message: "TS", + + optin_keywords: "TS", + + optout_keywords: "TS", + + help_keywords: "TS", + + optin_message: "TS", + + optout_message: "TS", + + + brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new(), + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::SMSTenDLCPartnerCampaign.new( + account_id: "TS", + + campaign_id: "TS", + + + status: Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE, + + + create_date: "2022-07-05T15:17:05Z", + brand_id: "TS", + + usecase: "TS", + + description: "TS", + + embedded_link: true, + + embedded_phone: true, + + affiliate_marketing: true, + + number_pool: true, + + age_gated: true, + + direct_lending: true, + + subscriber_optin: true, + + subscriber_optout: true, + + subscriber_help: true, + + sample1: "TS", + + sample2: "TS", + + sample3: "TS", + + sample4: "TS", + + sample5: "TS", + + message_flow: "TS", + + help_message: "TS", + + optin_keywords: "TS", + + optout_keywords: "TS", + + help_keywords: "TS", + + optin_message: "TS", + + optout_message: "TS", + + + brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new(), ) - expect(instance_1.eql?(instance_2)).to eq(false) - end - end - - describe 'test method "hash"' do - it 'calculates hash code' do - instance = Freeclimb::SMSTenDLCPartnerCampaign.new( - account_id: "TS", - campaign_id: "TS", - status:"ACTIVE", - create_date: "2022-07-05T15:17:05Z", - brand_id: "TS", - usecase: "TS", - description: "TS", - embedded_link: true, - embedded_phone: true, - affiliate_marketing: true, - number_pool: true, - age_gated: true, - direct_lending: true, - subscriber_optin: true, - subscriber_optout: true, - subscriber_help: true, - sample1: "TS", - sample2: "TS", - sample3: "TS", - sample4: "TS", - sample5: "TS", - message_flow: "TS", - help_message: "TS", - optin_keywords: "TS", - optout_keywords: "TS", - help_keywords: "TS", - optin_message: "TS", - optout_message: "TS", - brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new(), - ) - expect(instance.hash).to be_a_kind_of(Integer) - end - end - - describe 'test method "build_from_hash"' do - it 'builds equivalent model from hash code' do - instance_1 = Freeclimb::SMSTenDLCPartnerCampaign.new( + instance_2 = Freeclimb::SMSTenDLCPartnerCampaign.new( account_id: "TS", + campaign_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + + brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new(), ) - instance_2 = Freeclimb::SMSTenDLCPartnerCampaign.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -658,33 +1011,63 @@ describe 'test method "_deserialize"' do instance = Freeclimb::SMSTenDLCPartnerCampaign.new( account_id: "TS", + campaign_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + + brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new, ) it 'deserializes the data of account_id' do @@ -693,9 +1076,6 @@ it 'deserializes the data of campaign_id' do expect(instance._deserialize("String", instance.campaign_id)).to be_a_kind_of(String) end - it 'deserializes the data of status' do - expect(instance._deserialize("String", instance.status)).to be_a_kind_of(String) - end it 'deserializes the data of create_date' do expect(instance._deserialize("Time", instance.create_date)).to be_a_kind_of(Time) end @@ -780,33 +1160,63 @@ it 'returns the string representation of the object' do instance = Freeclimb::SMSTenDLCPartnerCampaign.new( account_id: "TS", + campaign_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + + brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new, ) expect(instance.to_s).to eq(instance.to_hash.to_s) @@ -817,33 +1227,63 @@ it 'returns the object in the form of hash' do instance = Freeclimb::SMSTenDLCPartnerCampaign.new( account_id: "TS", + campaign_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + + brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new, ) expect(instance.to_hash).to be_a_kind_of(Hash) @@ -852,64 +1292,124 @@ obj = Object.new() instance_1 = Freeclimb::SMSTenDLCPartnerCampaign.new( account_id: "TS", + campaign_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + + brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new, ) instance_2 = Freeclimb::SMSTenDLCPartnerCampaign.new( account_id: "TS", + campaign_id: "TS", - status:"ACTIVE", + + + status: Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + + brand: Freeclimb::SMSTenDLCPartnerCampaignBrand.new, ) expect(instance_1.to_hash).to eq(instance_2.to_hash) @@ -919,61 +1419,91 @@ describe 'test method "_to_hash"' do instance = Freeclimb::SMSTenDLCPartnerCampaign.new( account_id: "TS", + campaign_id: "TS", + - status:"ACTIVE", + + status: Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE, + + create_date: "2022-07-05T15:17:05Z", brand_id: "TS", + usecase: "TS", + description: "TS", + embedded_link: true, + embedded_phone: true, + affiliate_marketing: true, + number_pool: true, + age_gated: true, + direct_lending: true, + subscriber_optin: true, + subscriber_optout: true, + subscriber_help: true, + sample1: "TS", + sample2: "TS", + sample3: "TS", + sample4: "TS", + sample5: "TS", + message_flow: "TS", + help_message: "TS", + optin_keywords: "TS", + optout_keywords: "TS", + help_keywords: "TS", + optin_message: "TS", + optout_message: "TS", + + ) it 'returns account_id in the form of hash' do expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) diff --git a/spec/models/sms_ten_dlc_partner_campaign_status_spec.rb b/spec/models/sms_ten_dlc_partner_campaign_status_spec.rb new file mode 100644 index 00000000..64ed1a28 --- /dev/null +++ b/spec/models/sms_ten_dlc_partner_campaign_status_spec.rb @@ -0,0 +1,61 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::SMSTenDLCPartnerCampaignStatus +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::SMSTenDLCPartnerCampaignStatus do + let(:instance) { Freeclimb::SMSTenDLCPartnerCampaignStatus.new } + + describe 'test an instance of SMSTenDLCPartnerCampaignStatus' do + it 'should create an instance of SMSTenDLCPartnerCampaignStatus' do + expect(instance).to be_instance_of(Freeclimb::SMSTenDLCPartnerCampaignStatus) + end + end + + describe 'test attribute "ACTIVE"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE = "ACTIVE" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE + calculatedValue = Freeclimb::SMSTenDLCPartnerCampaignStatus::build_from_hash("ACTIVE") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "ACTIVE" + calculatedValue = Freeclimb::SMSTenDLCPartnerCampaignStatus::ACTIVE + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "EXPIRED"' do + it 'should work' do + expect { Freeclimb::SMSTenDLCPartnerCampaignStatus::EXPIRED = "EXPIRED" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTenDLCPartnerCampaignStatus::EXPIRED + calculatedValue = Freeclimb::SMSTenDLCPartnerCampaignStatus::build_from_hash("EXPIRED") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "EXPIRED" + calculatedValue = Freeclimb::SMSTenDLCPartnerCampaignStatus::EXPIRED + expect(expectedValue).to eq(calculatedValue) + end + end + +end diff --git a/spec/models/sms_ten_dlc_partner_campaigns_list_result_spec.rb b/spec/models/sms_ten_dlc_partner_campaigns_list_result_spec.rb index 5133f864..7bda01bc 100644 --- a/spec/models/sms_ten_dlc_partner_campaigns_list_result_spec.rb +++ b/spec/models/sms_ten_dlc_partner_campaigns_list_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,42 +104,66 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - partner_campaigns: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + partner_campaigns: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::SMSTenDLCPartnerCampaignsListResult' do - expect{instance = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - partner_campaigns: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + partner_campaigns: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - partner_campaigns: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + partner_campaigns: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -147,13 +171,21 @@ it 'checks if properties are valid' do instance = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + partner_campaigns: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -173,25 +205,39 @@ obj = Object.new() instance_1 = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - partner_campaigns: Freeclimb::SMSTenDLCPartnerCampaign.new(), + partner_campaigns: [], + ) instance_2 = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - partner_campaigns: Freeclimb::SMSTenDLCPartnerCampaign.new(), + partner_campaigns: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,25 +245,39 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( total: 2, + start: 2, + _end: 2, + page: 2, + num_pages: 2, + page_size: 2, + next_page_uri: "TS", - partner_campaigns: Freeclimb::SMSTenDLCPartnerCampaign.new(), + partner_campaigns: [], + ) instance_2 = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "ST", - partner_campaigns: Freeclimb::SMSTenDLCPartnerCampaign.new(), + partner_campaigns: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -227,15 +287,23 @@ it 'calculates hash code' do instance = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + partner_campaigns: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -243,15 +311,41 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + partner_campaigns: Array.new(), + ) - instance_2 = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new + instance_2 = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + partner_campaigns: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -259,13 +353,21 @@ describe 'test method "_deserialize"' do instance = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + partner_campaigns: Array.new(), + ) it 'deserializes the data of total' do expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) @@ -297,13 +399,21 @@ it 'returns the string representation of the object' do instance = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + partner_campaigns: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -313,13 +423,21 @@ it 'returns the object in the form of hash' do instance = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + partner_campaigns: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -327,23 +445,39 @@ obj = Object.new() instance_1 = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + partner_campaigns: Array.new(), + ) instance_2 = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + partner_campaigns: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -352,20 +486,28 @@ describe 'test method "_to_hash"' do instance = Freeclimb::SMSTenDLCPartnerCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + partner_campaigns: Array.new(), + ) it 'returns total in the form of hash' do expect(instance._to_hash(instance.total)).to eq(instance.total) diff --git a/spec/models/sms_toll_free_campaign_registration_status_spec.rb b/spec/models/sms_toll_free_campaign_registration_status_spec.rb new file mode 100644 index 00000000..96869bd5 --- /dev/null +++ b/spec/models/sms_toll_free_campaign_registration_status_spec.rb @@ -0,0 +1,109 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::SMSTollFreeCampaignRegistrationStatus +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::SMSTollFreeCampaignRegistrationStatus do + let(:instance) { Freeclimb::SMSTollFreeCampaignRegistrationStatus.new } + + describe 'test an instance of SMSTollFreeCampaignRegistrationStatus' do + it 'should create an instance of SMSTollFreeCampaignRegistrationStatus' do + expect(instance).to be_instance_of(Freeclimb::SMSTollFreeCampaignRegistrationStatus) + end + end + + describe 'test attribute "UNREGISTERED"' do + it 'should work' do + expect { Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED = "UNREGISTERED" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED + calculatedValue = Freeclimb::SMSTollFreeCampaignRegistrationStatus::build_from_hash("UNREGISTERED") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "UNREGISTERED" + calculatedValue = Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "INITIATED"' do + it 'should work' do + expect { Freeclimb::SMSTollFreeCampaignRegistrationStatus::INITIATED = "INITIATED" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTollFreeCampaignRegistrationStatus::INITIATED + calculatedValue = Freeclimb::SMSTollFreeCampaignRegistrationStatus::build_from_hash("INITIATED") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "INITIATED" + calculatedValue = Freeclimb::SMSTollFreeCampaignRegistrationStatus::INITIATED + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "PENDING"' do + it 'should work' do + expect { Freeclimb::SMSTollFreeCampaignRegistrationStatus::PENDING = "PENDING" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTollFreeCampaignRegistrationStatus::PENDING + calculatedValue = Freeclimb::SMSTollFreeCampaignRegistrationStatus::build_from_hash("PENDING") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "PENDING" + calculatedValue = Freeclimb::SMSTollFreeCampaignRegistrationStatus::PENDING + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "DECLINED"' do + it 'should work' do + expect { Freeclimb::SMSTollFreeCampaignRegistrationStatus::DECLINED = "DECLINED" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTollFreeCampaignRegistrationStatus::DECLINED + calculatedValue = Freeclimb::SMSTollFreeCampaignRegistrationStatus::build_from_hash("DECLINED") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "DECLINED" + calculatedValue = Freeclimb::SMSTollFreeCampaignRegistrationStatus::DECLINED + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "REGISTERED"' do + it 'should work' do + expect { Freeclimb::SMSTollFreeCampaignRegistrationStatus::REGISTERED = "REGISTERED" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::SMSTollFreeCampaignRegistrationStatus::REGISTERED + calculatedValue = Freeclimb::SMSTollFreeCampaignRegistrationStatus::build_from_hash("REGISTERED") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "REGISTERED" + calculatedValue = Freeclimb::SMSTollFreeCampaignRegistrationStatus::REGISTERED + expect(expectedValue).to eq(calculatedValue) + end + end + +end diff --git a/spec/models/sms_toll_free_campaign_spec.rb b/spec/models/sms_toll_free_campaign_spec.rb index 432f4d2b..f5149322 100644 --- a/spec/models/sms_toll_free_campaign_spec.rb +++ b/spec/models/sms_toll_free_campaign_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -52,38 +52,27 @@ describe 'test attribute "registration_status"' do - it 'assigns value UNREGISTERED' do - instance.registration_status = "UNREGISTERED" - expect(instance.registration_status).to eq("UNREGISTERED") + instance.registration_status = Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED + expect(instance.registration_status).to eq(Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED) end - it 'assigns value INITIATED' do - instance.registration_status = "INITIATED" - expect(instance.registration_status).to eq("INITIATED") + instance.registration_status = Freeclimb::SMSTollFreeCampaignRegistrationStatus::INITIATED + expect(instance.registration_status).to eq(Freeclimb::SMSTollFreeCampaignRegistrationStatus::INITIATED) end - it 'assigns value PENDING' do - instance.registration_status = "PENDING" - expect(instance.registration_status).to eq("PENDING") + instance.registration_status = Freeclimb::SMSTollFreeCampaignRegistrationStatus::PENDING + expect(instance.registration_status).to eq(Freeclimb::SMSTollFreeCampaignRegistrationStatus::PENDING) end - it 'assigns value DECLINED' do - instance.registration_status = "DECLINED" - expect(instance.registration_status).to eq("DECLINED") + instance.registration_status = Freeclimb::SMSTollFreeCampaignRegistrationStatus::DECLINED + expect(instance.registration_status).to eq(Freeclimb::SMSTollFreeCampaignRegistrationStatus::DECLINED) end - it 'assigns value REGISTERED' do - instance.registration_status = "REGISTERED" - expect(instance.registration_status).to eq("REGISTERED") - end - - it 'throws error on invalid enum' do - instance = Freeclimb::SMSTollFreeCampaign.new - expect{instance.registration_status = "INVALID_ENUM"}.to raise_error(ArgumentError) + instance.registration_status = Freeclimb::SMSTollFreeCampaignRegistrationStatus::REGISTERED + expect(instance.registration_status).to eq(Freeclimb::SMSTollFreeCampaignRegistrationStatus::REGISTERED) end end - describe 'test attribute "date_created"' do it 'should work' do instance.date_created = "TEST_STRING" @@ -112,39 +101,63 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::SMSTollFreeCampaign.new( - account_id: "TS", - campaign_id: "TS", - use_case: "TS", - registration_status:"UNREGISTERED", - date_created: "TS", - date_updated: "TS", - revision: 1, - )}.not_to raise_error() + expect { instance = Freeclimb::SMSTollFreeCampaign.new( + account_id: "TS", + + campaign_id: "TS", + + use_case: "TS", + + + registration_status: Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED, + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::SMSTollFreeCampaign' do - expect{instance = Freeclimb::SMSTollFreeCampaign.new( - account_id: "TS", - campaign_id: "TS", - use_case: "TS", - registration_status:"UNREGISTERED", - date_created: "TS", - date_updated: "TS", - revision: 1, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SMSTollFreeCampaign.new( + account_id: "TS", + + campaign_id: "TS", + + use_case: "TS", + + + registration_status: Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED, + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::SMSTollFreeCampaign.new( - account_id: "TS", - campaign_id: "TS", - use_case: "TS", - registration_status:"UNREGISTERED", - date_created: "TS", - date_updated: "TS", - revision: 1, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SMSTollFreeCampaign.new( + account_id: "TS", + + campaign_id: "TS", + + use_case: "TS", + + + registration_status: Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED, + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -152,12 +165,20 @@ it 'checks if properties are valid' do instance = Freeclimb::SMSTollFreeCampaign.new( account_id: "TS", + campaign_id: "TS", + use_case: "TS", - registration_status:"UNREGISTERED", + + + registration_status: Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED, + date_created: "TS", + date_updated: "TS", + revision: 1, + ) expect(instance.valid?).to eq(true) end @@ -177,21 +198,37 @@ obj = Object.new() instance_1 = Freeclimb::SMSTollFreeCampaign.new( account_id: "TS", + campaign_id: "TS", + use_case: "TS", - registration_status:"UNREGISTERED", + + + registration_status: Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED, + date_created: "TS", + date_updated: "TS", + revision: 1, + ) instance_2 = Freeclimb::SMSTollFreeCampaign.new( account_id: "TS", + campaign_id: "TS", + use_case: "TS", - registration_status:"UNREGISTERED", + + + registration_status: Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED, + date_created: "TS", + date_updated: "TS", + revision: 1, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,21 +236,37 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::SMSTollFreeCampaign.new( account_id: "TS", + campaign_id: "TS", + use_case: "TS", - registration_status:"UNREGISTERED", + + + registration_status: Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED, + date_created: "TS", + date_updated: "TS", + revision: 2, + ) instance_2 = Freeclimb::SMSTollFreeCampaign.new( account_id: "ST", + campaign_id: "ST", + use_case: "ST", - registration_status:"UNREGISTERED", + + + registration_status: nil, + date_created: "ST", + date_updated: "ST", + revision: 1, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -223,14 +276,22 @@ it 'calculates hash code' do instance = Freeclimb::SMSTollFreeCampaign.new( account_id: "TS", + campaign_id: "TS", + use_case: "TS", - registration_status:"UNREGISTERED", + + + registration_status: Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED, + date_created: "TS", + date_updated: "TS", + revision: 1, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -238,14 +299,39 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::SMSTollFreeCampaign.new( account_id: "TS", + campaign_id: "TS", + + use_case: "TS", + + + registration_status: Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED, + + date_created: "TS", + + date_updated: "TS", + + revision: 1, + + ) + instance_2 = Freeclimb::SMSTollFreeCampaign.new( + account_id: "TS", + + campaign_id: "TS", + use_case: "TS", - registration_status:"UNREGISTERED", + + + registration_status: Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED, + date_created: "TS", + date_updated: "TS", + revision: 1, + ) - instance_2 = Freeclimb::SMSTollFreeCampaign.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -253,12 +339,20 @@ describe 'test method "_deserialize"' do instance = Freeclimb::SMSTollFreeCampaign.new( account_id: "TS", + campaign_id: "TS", + use_case: "TS", - registration_status:"UNREGISTERED", + + + registration_status: Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED, + date_created: "TS", + date_updated: "TS", + revision: 1, + ) it 'deserializes the data of account_id' do expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) @@ -269,9 +363,6 @@ it 'deserializes the data of use_case' do expect(instance._deserialize("String", instance.use_case)).to be_a_kind_of(String) end - it 'deserializes the data of registration_status' do - expect(instance._deserialize("String", instance.registration_status)).to be_a_kind_of(String) - end it 'deserializes the data of date_created' do expect(instance._deserialize("String", instance.date_created)).to be_a_kind_of(String) end @@ -287,12 +378,20 @@ it 'returns the string representation of the object' do instance = Freeclimb::SMSTollFreeCampaign.new( account_id: "TS", + campaign_id: "TS", + use_case: "TS", - registration_status:"UNREGISTERED", + + + registration_status: Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED, + date_created: "TS", + date_updated: "TS", + revision: 1, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -302,12 +401,20 @@ it 'returns the object in the form of hash' do instance = Freeclimb::SMSTollFreeCampaign.new( account_id: "TS", + campaign_id: "TS", + use_case: "TS", - registration_status:"UNREGISTERED", + + + registration_status: Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED, + date_created: "TS", + date_updated: "TS", + revision: 1, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -315,21 +422,37 @@ obj = Object.new() instance_1 = Freeclimb::SMSTollFreeCampaign.new( account_id: "TS", + campaign_id: "TS", + use_case: "TS", - registration_status:"UNREGISTERED", + + + registration_status: Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED, + date_created: "TS", + date_updated: "TS", + revision: 1, + ) instance_2 = Freeclimb::SMSTollFreeCampaign.new( account_id: "TS", + campaign_id: "TS", + use_case: "TS", - registration_status:"UNREGISTERED", + + + registration_status: Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED, + date_created: "TS", + date_updated: "TS", + revision: 1, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -338,18 +461,26 @@ describe 'test method "_to_hash"' do instance = Freeclimb::SMSTollFreeCampaign.new( account_id: "TS", + campaign_id: "TS", + use_case: "TS", + - registration_status:"UNREGISTERED", + + registration_status: Freeclimb::SMSTollFreeCampaignRegistrationStatus::UNREGISTERED, + date_created: "TS", + date_updated: "TS", + revision: 1, + ) it 'returns account_id in the form of hash' do expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) diff --git a/spec/models/sms_toll_free_campaigns_list_result_spec.rb b/spec/models/sms_toll_free_campaigns_list_result_spec.rb index 5b2156df..6f3b8116 100644 --- a/spec/models/sms_toll_free_campaigns_list_result_spec.rb +++ b/spec/models/sms_toll_free_campaigns_list_result_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -104,42 +104,66 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::SMSTollFreeCampaignsListResult.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - brands: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::SMSTollFreeCampaignsListResult.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + brands: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::SMSTollFreeCampaignsListResult' do - expect{instance = Freeclimb::SMSTollFreeCampaignsListResult.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - brands: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SMSTollFreeCampaignsListResult.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + brands: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::SMSTollFreeCampaignsListResult.new( - total: 1, - start: 1, - _end: 1, - page: 1, - num_pages: 1, - page_size: 1, - next_page_uri: "TS", - brands: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::SMSTollFreeCampaignsListResult.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + brands: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -147,13 +171,21 @@ it 'checks if properties are valid' do instance = Freeclimb::SMSTollFreeCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -173,25 +205,39 @@ obj = Object.new() instance_1 = Freeclimb::SMSTollFreeCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - brands: Freeclimb::SMSTollFreeCampaign.new(), + brands: [], + ) instance_2 = Freeclimb::SMSTollFreeCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", - brands: Freeclimb::SMSTollFreeCampaign.new(), + brands: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -199,25 +245,39 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::SMSTollFreeCampaignsListResult.new( total: 2, + start: 2, + _end: 2, + page: 2, + num_pages: 2, + page_size: 2, + next_page_uri: "TS", - brands: Freeclimb::SMSTollFreeCampaign.new(), + brands: [], + ) instance_2 = Freeclimb::SMSTollFreeCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "ST", - brands: Freeclimb::SMSTollFreeCampaign.new(), + brands: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -227,15 +287,23 @@ it 'calculates hash code' do instance = Freeclimb::SMSTollFreeCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -243,15 +311,41 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::SMSTollFreeCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) - instance_2 = Freeclimb::SMSTollFreeCampaignsListResult.new + instance_2 = Freeclimb::SMSTollFreeCampaignsListResult.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + brands: Array.new(), + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -259,13 +353,21 @@ describe 'test method "_deserialize"' do instance = Freeclimb::SMSTollFreeCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) it 'deserializes the data of total' do expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) @@ -297,13 +399,21 @@ it 'returns the string representation of the object' do instance = Freeclimb::SMSTollFreeCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -313,13 +423,21 @@ it 'returns the object in the form of hash' do instance = Freeclimb::SMSTollFreeCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -327,23 +445,39 @@ obj = Object.new() instance_1 = Freeclimb::SMSTollFreeCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) instance_2 = Freeclimb::SMSTollFreeCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -352,20 +486,28 @@ describe 'test method "_to_hash"' do instance = Freeclimb::SMSTollFreeCampaignsListResult.new( total: 1, + start: 1, + _end: 1, + page: 1, + num_pages: 1, + page_size: 1, + next_page_uri: "TS", + brands: Array.new(), + ) it 'returns total in the form of hash' do expect(instance._to_hash(instance.total)).to eq(instance.total) diff --git a/spec/models/start_record_call_spec.rb b/spec/models/start_record_call_spec.rb index d06f7513..5cc59eec 100644 --- a/spec/models/start_record_call_spec.rb +++ b/spec/models/start_record_call_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/terminate_conference_spec.rb b/spec/models/terminate_conference_spec.rb index 3f22bd6c..30560532 100644 --- a/spec/models/terminate_conference_spec.rb +++ b/spec/models/terminate_conference_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/tfn_spec.rb b/spec/models/tfn_spec.rb index 771990a1..f50f80ee 100644 --- a/spec/models/tfn_spec.rb +++ b/spec/models/tfn_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -36,21 +36,24 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::TFN.new( - campaign_id: "TS", - )}.not_to raise_error() + expect { instance = Freeclimb::TFN.new( + campaign_id: "TS", + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::TFN' do - expect{instance = Freeclimb::TFN.new( - campaign_id: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::TFN.new( + campaign_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::TFN.new( - campaign_id: "TS", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::TFN.new( + campaign_id: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -58,6 +61,7 @@ it 'checks if properties are valid' do instance = Freeclimb::TFN.new( campaign_id: "TS", + ) expect(instance.valid?).to eq(true) end @@ -77,9 +81,11 @@ obj = Object.new() instance_1 = Freeclimb::TFN.new( campaign_id: "TS", + ) instance_2 = Freeclimb::TFN.new( campaign_id: "TS", + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -87,9 +93,11 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::TFN.new( campaign_id: "TS", + ) instance_2 = Freeclimb::TFN.new( campaign_id: "ST", + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -99,8 +107,9 @@ it 'calculates hash code' do instance = Freeclimb::TFN.new( campaign_id: "TS", + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -108,8 +117,13 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::TFN.new( campaign_id: "TS", + ) - instance_2 = Freeclimb::TFN.new + instance_2 = Freeclimb::TFN.new( + campaign_id: "TS", + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -117,6 +131,7 @@ describe 'test method "_deserialize"' do instance = Freeclimb::TFN.new( campaign_id: "TS", + ) it 'deserializes the data of campaign_id' do expect(instance._deserialize("String", instance.campaign_id)).to be_a_kind_of(String) @@ -127,6 +142,7 @@ it 'returns the string representation of the object' do instance = Freeclimb::TFN.new( campaign_id: "TS", + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -136,6 +152,7 @@ it 'returns the object in the form of hash' do instance = Freeclimb::TFN.new( campaign_id: "TS", + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -143,9 +160,11 @@ obj = Object.new() instance_1 = Freeclimb::TFN.new( campaign_id: "TS", + ) instance_2 = Freeclimb::TFN.new( campaign_id: "TS", + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -154,6 +173,7 @@ describe 'test method "_to_hash"' do instance = Freeclimb::TFN.new( campaign_id: "TS", + ) it 'returns campaign_id in the form of hash' do expect(instance._to_hash(instance.campaign_id)).to eq(instance.campaign_id) diff --git a/spec/models/transcribe_reason_spec.rb b/spec/models/transcribe_reason_spec.rb new file mode 100644 index 00000000..8fb26d94 --- /dev/null +++ b/spec/models/transcribe_reason_spec.rb @@ -0,0 +1,109 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::TranscribeReason +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::TranscribeReason do + let(:instance) { Freeclimb::TranscribeReason.new } + + describe 'test an instance of TranscribeReason' do + it 'should create an instance of TranscribeReason' do + expect(instance).to be_instance_of(Freeclimb::TranscribeReason) + end + end + + describe 'test attribute "INTERNAL_ERROR"' do + it 'should work' do + expect { Freeclimb::TranscribeReason::INTERNAL_ERROR = "internalError" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::TranscribeReason::INTERNAL_ERROR + calculatedValue = Freeclimb::TranscribeReason::build_from_hash("internalError") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "internalError" + calculatedValue = Freeclimb::TranscribeReason::INTERNAL_ERROR + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "HANGUP"' do + it 'should work' do + expect { Freeclimb::TranscribeReason::HANGUP = "hangup" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::TranscribeReason::HANGUP + calculatedValue = Freeclimb::TranscribeReason::build_from_hash("hangup") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "hangup" + calculatedValue = Freeclimb::TranscribeReason::HANGUP + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "MAX_LENGTH"' do + it 'should work' do + expect { Freeclimb::TranscribeReason::MAX_LENGTH = "maxLength" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::TranscribeReason::MAX_LENGTH + calculatedValue = Freeclimb::TranscribeReason::build_from_hash("maxLength") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "maxLength" + calculatedValue = Freeclimb::TranscribeReason::MAX_LENGTH + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "DIGIT"' do + it 'should work' do + expect { Freeclimb::TranscribeReason::DIGIT = "digit" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::TranscribeReason::DIGIT + calculatedValue = Freeclimb::TranscribeReason::build_from_hash("digit") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "digit" + calculatedValue = Freeclimb::TranscribeReason::DIGIT + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "NO_INPUT"' do + it 'should work' do + expect { Freeclimb::TranscribeReason::NO_INPUT = "noInput" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::TranscribeReason::NO_INPUT + calculatedValue = Freeclimb::TranscribeReason::build_from_hash("noInput") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "noInput" + calculatedValue = Freeclimb::TranscribeReason::NO_INPUT + expect(expectedValue).to eq(calculatedValue) + end + end + +end diff --git a/spec/models/transcribe_term_reason_spec.rb b/spec/models/transcribe_term_reason_spec.rb new file mode 100644 index 00000000..1d978d4f --- /dev/null +++ b/spec/models/transcribe_term_reason_spec.rb @@ -0,0 +1,61 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::TranscribeTermReason +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::TranscribeTermReason do + let(:instance) { Freeclimb::TranscribeTermReason.new } + + describe 'test an instance of TranscribeTermReason' do + it 'should create an instance of TranscribeTermReason' do + expect(instance).to be_instance_of(Freeclimb::TranscribeTermReason) + end + end + + describe 'test attribute "ERROR"' do + it 'should work' do + expect { Freeclimb::TranscribeTermReason::ERROR = "error" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::TranscribeTermReason::ERROR + calculatedValue = Freeclimb::TranscribeTermReason::build_from_hash("error") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "error" + calculatedValue = Freeclimb::TranscribeTermReason::ERROR + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "COMPLETED"' do + it 'should work' do + expect { Freeclimb::TranscribeTermReason::COMPLETED = "completed" }.not_to raise_error + end + it 'should serialize to enum' do + expectedValue = Freeclimb::TranscribeTermReason::COMPLETED + calculatedValue = Freeclimb::TranscribeTermReason::build_from_hash("completed") + expect(expectedValue).to eq(calculatedValue) + end + it 'should deserialize to string' do + expectedValue = "completed" + calculatedValue = Freeclimb::TranscribeTermReason::COMPLETED + expect(expectedValue).to eq(calculatedValue) + end + end + +end diff --git a/spec/models/transcribe_utterance_all_of_record_spec.rb b/spec/models/transcribe_utterance_record_spec.rb similarity index 68% rename from spec/models/transcribe_utterance_all_of_record_spec.rb rename to spec/models/transcribe_utterance_record_spec.rb index aacfe355..4332d42f 100644 --- a/spec/models/transcribe_utterance_all_of_record_spec.rb +++ b/spec/models/transcribe_utterance_record_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -14,15 +14,15 @@ require 'json' require 'date' -# Unit tests for Freeclimb::TranscribeUtteranceAllOfRecord +# Unit tests for Freeclimb::TranscribeUtteranceRecord # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe Freeclimb::TranscribeUtteranceAllOfRecord do - let(:instance) { Freeclimb::TranscribeUtteranceAllOfRecord.new } +describe Freeclimb::TranscribeUtteranceRecord do + let(:instance) { Freeclimb::TranscribeUtteranceRecord.new } - describe 'test an instance of TranscribeUtteranceAllOfRecord' do - it 'should create an instance of TranscribeUtteranceAllOfRecord' do - expect(instance).to be_instance_of(Freeclimb::TranscribeUtteranceAllOfRecord) + describe 'test an instance of TranscribeUtteranceRecord' do + it 'should create an instance of TranscribeUtteranceRecord' do + expect(instance).to be_instance_of(Freeclimb::TranscribeUtteranceRecord) end end @@ -36,7 +36,7 @@ describe 'test attribute "max_length_sec"' do it 'should work' do - instance.max_length_sec = 60 + instance.max_length_sec = 60 expect(instance.max_length_sec).to eq(60) @@ -46,7 +46,7 @@ describe 'test attribute "rcrd_termination_silence_time_ms"' do it 'should work' do - instance.rcrd_termination_silence_time_ms = 3000 + instance.rcrd_termination_silence_time_ms = 3000 expect(instance.rcrd_termination_silence_time_ms).to eq(3000) @@ -56,43 +56,55 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::TranscribeUtteranceAllOfRecord.new( - save_recording: true, - max_length_sec: 60, - rcrd_termination_silence_time_ms: 3000, - )}.not_to raise_error() + expect { instance = Freeclimb::TranscribeUtteranceRecord.new( + save_recording: true, + + max_length_sec: 60, + + rcrd_termination_silence_time_ms: 3000, + + )}.not_to raise_error() end - it 'fails to initialize with input argument that is not a hash in Freeclimb::TranscribeUtteranceAllOfRecord' do - expect{instance = Freeclimb::TranscribeUtteranceAllOfRecord.new( - save_recording: true, - max_length_sec: 60, - rcrd_termination_silence_time_ms: 3000, - invalid_attribute: true - )}.to raise_error(ArgumentError) + it 'fails to initialize with input argument that is not a hash in Freeclimb::TranscribeUtteranceRecord' do + expect { instance = Freeclimb::TranscribeUtteranceRecord.new( + save_recording: true, + + max_length_sec: 60, + + rcrd_termination_silence_time_ms: 3000, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::TranscribeUtteranceAllOfRecord.new( - save_recording: true, - max_length_sec: 60, - rcrd_termination_silence_time_ms: 3000, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::TranscribeUtteranceRecord.new( + save_recording: true, + + max_length_sec: 60, + + rcrd_termination_silence_time_ms: 3000, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end describe 'test method "valid"' do it 'checks if properties are valid' do - instance = Freeclimb::TranscribeUtteranceAllOfRecord.new( + instance = Freeclimb::TranscribeUtteranceRecord.new( save_recording: true, + max_length_sec: 60, + rcrd_termination_silence_time_ms: 3000, + ) expect(instance.valid?).to eq(true) end skip 'checks if properties are invalid' do - instance = Freeclimb::TranscribeUtteranceAllOfRecord.new( + instance = Freeclimb::TranscribeUtteranceRecord.new( ) expect(instance.valid?).to eq(false) @@ -103,29 +115,41 @@ describe 'test method "eql?"' do it 'checks if objects are equal' do obj = Object.new() - instance_1 = Freeclimb::TranscribeUtteranceAllOfRecord.new( + instance_1 = Freeclimb::TranscribeUtteranceRecord.new( save_recording: true, + max_length_sec: 60, + rcrd_termination_silence_time_ms: 3000, + ) - instance_2 = Freeclimb::TranscribeUtteranceAllOfRecord.new( + instance_2 = Freeclimb::TranscribeUtteranceRecord.new( save_recording: true, + max_length_sec: 60, + rcrd_termination_silence_time_ms: 3000, + ) expect(instance_1.eql?(instance_2)).to eq(true) end it 'checks if objects are not equal' do - instance_1 = Freeclimb::TranscribeUtteranceAllOfRecord.new( + instance_1 = Freeclimb::TranscribeUtteranceRecord.new( save_recording: true, + max_length_sec: 60 - 1, + rcrd_termination_silence_time_ms: 3000 - 1, + ) - instance_2 = Freeclimb::TranscribeUtteranceAllOfRecord.new( + instance_2 = Freeclimb::TranscribeUtteranceRecord.new( save_recording: false, + max_length_sec: 60 - 2, + rcrd_termination_silence_time_ms: 3000 - 2, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -133,32 +157,49 @@ describe 'test method "hash"' do it 'calculates hash code' do - instance = Freeclimb::TranscribeUtteranceAllOfRecord.new( + instance = Freeclimb::TranscribeUtteranceRecord.new( save_recording: true, + max_length_sec: 60, + rcrd_termination_silence_time_ms: 3000, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end describe 'test method "build_from_hash"' do it 'builds equivalent model from hash code' do - instance_1 = Freeclimb::TranscribeUtteranceAllOfRecord.new( + instance_1 = Freeclimb::TranscribeUtteranceRecord.new( save_recording: true, + max_length_sec: 60, + rcrd_termination_silence_time_ms: 3000, + ) - instance_2 = Freeclimb::TranscribeUtteranceAllOfRecord.new + instance_2 = Freeclimb::TranscribeUtteranceRecord.new( + save_recording: true, + + max_length_sec: 60, + + rcrd_termination_silence_time_ms: 3000, + + ) + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end describe 'test method "_deserialize"' do - instance = Freeclimb::TranscribeUtteranceAllOfRecord.new( + instance = Freeclimb::TranscribeUtteranceRecord.new( save_recording: true, + max_length_sec: 60, + rcrd_termination_silence_time_ms: 3000, + ) it 'deserializes the data of save_recording' do expect(instance._deserialize("Boolean", instance.save_recording)).to be_a_kind_of(TrueClass) @@ -173,10 +214,13 @@ describe 'test method "to_s"' do it 'returns the string representation of the object' do - instance = Freeclimb::TranscribeUtteranceAllOfRecord.new( + instance = Freeclimb::TranscribeUtteranceRecord.new( save_recording: true, + max_length_sec: 60, + rcrd_termination_silence_time_ms: 3000, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -184,36 +228,48 @@ describe 'test method "to_hash"' do it 'returns the object in the form of hash' do - instance = Freeclimb::TranscribeUtteranceAllOfRecord.new( + instance = Freeclimb::TranscribeUtteranceRecord.new( save_recording: true, + max_length_sec: 60, + rcrd_termination_silence_time_ms: 3000, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end it 'creates equal hash for two equal objects' do obj = Object.new() - instance_1 = Freeclimb::TranscribeUtteranceAllOfRecord.new( + instance_1 = Freeclimb::TranscribeUtteranceRecord.new( save_recording: true, + max_length_sec: 60, + rcrd_termination_silence_time_ms: 3000, + ) - instance_2 = Freeclimb::TranscribeUtteranceAllOfRecord.new( + instance_2 = Freeclimb::TranscribeUtteranceRecord.new( save_recording: true, + max_length_sec: 60, + rcrd_termination_silence_time_ms: 3000, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end end describe 'test method "_to_hash"' do - instance = Freeclimb::TranscribeUtteranceAllOfRecord.new( + instance = Freeclimb::TranscribeUtteranceRecord.new( save_recording: true, + max_length_sec: 60, + rcrd_termination_silence_time_ms: 3000, + ) it 'returns save_recording in the form of hash' do expect(instance._to_hash(instance.save_recording)).to eq(instance.save_recording) diff --git a/spec/models/transcribe_utterance_spec.rb b/spec/models/transcribe_utterance_spec.rb index 75b924b4..6bee0546 100644 --- a/spec/models/transcribe_utterance_spec.rb +++ b/spec/models/transcribe_utterance_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -45,8 +45,8 @@ describe 'test attribute "record"' do it 'should work' do - instance.record = Freeclimb::TranscribeUtteranceAllOfRecord.new - expect(instance.record).to be_instance_of(Freeclimb::TranscribeUtteranceAllOfRecord) + instance.record = Freeclimb::TranscribeUtteranceRecord.new + expect(instance.record).to be_instance_of(Freeclimb::TranscribeUtteranceRecord) end end @@ -76,36 +76,54 @@ describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::TranscribeUtterance.new( - action_url: "TS", - play_beep: true, - record: Freeclimb::TranscribeUtteranceAllOfRecord.new(), - privacy_for_logging: true, - privacy_for_recording: true, - prompts: Array.new(), - )}.not_to raise_error() + expect { instance = Freeclimb::TranscribeUtterance.new( + action_url: "TS", + + play_beep: true, + + + record: Freeclimb::TranscribeUtteranceRecord.new(), + privacy_for_logging: true, + + privacy_for_recording: true, + + prompts: Array.new(), + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::TranscribeUtterance' do - expect{instance = Freeclimb::TranscribeUtterance.new( - action_url: "TS", - play_beep: true, - record: Freeclimb::TranscribeUtteranceAllOfRecord.new, - privacy_for_logging: true, - privacy_for_recording: true, - prompts: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::TranscribeUtterance.new( + action_url: "TS", + + play_beep: true, + + + record: Freeclimb::TranscribeUtteranceRecord.new, + privacy_for_logging: true, + + privacy_for_recording: true, + + prompts: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::TranscribeUtterance.new( - action_url: "TS", - play_beep: true, - record: Freeclimb::TranscribeUtteranceAllOfRecord.new, - privacy_for_logging: true, - privacy_for_recording: true, - prompts: Array.new(), - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::TranscribeUtterance.new( + action_url: "TS", + + play_beep: true, + + + record: Freeclimb::TranscribeUtteranceRecord.new, + privacy_for_logging: true, + + privacy_for_recording: true, + + prompts: Array.new(), + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -113,11 +131,17 @@ it 'checks if properties are valid' do instance = Freeclimb::TranscribeUtterance.new( action_url: "TS", + play_beep: true, - record: Freeclimb::TranscribeUtteranceAllOfRecord.new(), + + + record: Freeclimb::TranscribeUtteranceRecord.new(), privacy_for_logging: true, + privacy_for_recording: true, + prompts: Array.new(), + ) expect(instance.valid?).to eq(true) end @@ -137,19 +161,31 @@ obj = Object.new() instance_1 = Freeclimb::TranscribeUtterance.new( action_url: "TS", + play_beep: true, - record: Freeclimb::TranscribeUtteranceAllOfRecord.new(), + + record: Freeclimb::TranscribeUtteranceRecord.new(), + privacy_for_logging: true, + privacy_for_recording: true, + prompts: [], + ) instance_2 = Freeclimb::TranscribeUtterance.new( action_url: "TS", + play_beep: true, - record: Freeclimb::TranscribeUtteranceAllOfRecord.new(), + + record: Freeclimb::TranscribeUtteranceRecord.new(), + privacy_for_logging: true, + privacy_for_recording: true, + prompts: [], + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -157,19 +193,31 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::TranscribeUtterance.new( action_url: "TS", + play_beep: true, - record: Freeclimb::TranscribeUtteranceAllOfRecord.new(), + + record: Freeclimb::TranscribeUtteranceRecord.new(), + privacy_for_logging: true, + privacy_for_recording: true, + prompts: [], + ) instance_2 = Freeclimb::TranscribeUtterance.new( action_url: "ST", + play_beep: false, - record: Freeclimb::TranscribeUtteranceAllOfRecord.new(), + + record: Freeclimb::TranscribeUtteranceRecord.new(), + privacy_for_logging: false, + privacy_for_recording: false, + prompts: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -179,13 +227,19 @@ it 'calculates hash code' do instance = Freeclimb::TranscribeUtterance.new( action_url: "TS", + play_beep: true, - record: Freeclimb::TranscribeUtteranceAllOfRecord.new(), + + + record: Freeclimb::TranscribeUtteranceRecord.new(), privacy_for_logging: true, + privacy_for_recording: true, + prompts: Array.new(), + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -193,13 +247,33 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::TranscribeUtterance.new( action_url: "TS", + + play_beep: true, + + + record: Freeclimb::TranscribeUtteranceRecord.new(), + privacy_for_logging: true, + + privacy_for_recording: true, + + prompts: Array.new(), + + ) + instance_2 = Freeclimb::TranscribeUtterance.new( + action_url: "TS", + play_beep: true, - record: Freeclimb::TranscribeUtteranceAllOfRecord.new(), + + + record: Freeclimb::TranscribeUtteranceRecord.new(), privacy_for_logging: true, + privacy_for_recording: true, + prompts: Array.new(), + ) - instance_2 = Freeclimb::TranscribeUtterance.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -207,11 +281,17 @@ describe 'test method "_deserialize"' do instance = Freeclimb::TranscribeUtterance.new( action_url: "TS", + play_beep: true, - record: Freeclimb::TranscribeUtteranceAllOfRecord.new, + + + record: Freeclimb::TranscribeUtteranceRecord.new, privacy_for_logging: true, + privacy_for_recording: true, + prompts: Array.new(), + ) it 'deserializes the data of action_url' do expect(instance._deserialize("String", instance.action_url)).to be_a_kind_of(String) @@ -220,7 +300,7 @@ expect(instance._deserialize("Boolean", instance.play_beep)).to be_a_kind_of(TrueClass) end it 'deserializes the data of record' do - expect(instance._deserialize("Object", instance.record)).to be_a_kind_of(Freeclimb::TranscribeUtteranceAllOfRecord) + expect(instance._deserialize("Object", instance.record)).to be_a_kind_of(Freeclimb::TranscribeUtteranceRecord) end it 'deserializes the data of privacy_for_logging' do expect(instance._deserialize("Boolean", instance.privacy_for_logging)).to be_a_kind_of(TrueClass) @@ -229,7 +309,7 @@ expect(instance._deserialize("Boolean", instance.privacy_for_recording)).to be_a_kind_of(TrueClass) end it 'deserializes the data of prompts' do - expect(instance._deserialize("Array", instance.prompts)).to be_a_kind_of(Array) + expect(instance._deserialize("Array", instance.prompts)).to be_a_kind_of(Array) end end @@ -237,11 +317,17 @@ it 'returns the string representation of the object' do instance = Freeclimb::TranscribeUtterance.new( action_url: "TS", + play_beep: true, - record: Freeclimb::TranscribeUtteranceAllOfRecord.new, + + + record: Freeclimb::TranscribeUtteranceRecord.new, privacy_for_logging: true, + privacy_for_recording: true, + prompts: Array.new(), + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -251,11 +337,17 @@ it 'returns the object in the form of hash' do instance = Freeclimb::TranscribeUtterance.new( action_url: "TS", + play_beep: true, - record: Freeclimb::TranscribeUtteranceAllOfRecord.new, + + + record: Freeclimb::TranscribeUtteranceRecord.new, privacy_for_logging: true, + privacy_for_recording: true, + prompts: Array.new(), + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -263,19 +355,31 @@ obj = Object.new() instance_1 = Freeclimb::TranscribeUtterance.new( action_url: "TS", + play_beep: true, - record: Freeclimb::TranscribeUtteranceAllOfRecord.new, + + + record: Freeclimb::TranscribeUtteranceRecord.new, privacy_for_logging: true, + privacy_for_recording: true, + prompts: Array.new(), + ) instance_2 = Freeclimb::TranscribeUtterance.new( action_url: "TS", + play_beep: true, - record: Freeclimb::TranscribeUtteranceAllOfRecord.new, + + + record: Freeclimb::TranscribeUtteranceRecord.new, privacy_for_logging: true, + privacy_for_recording: true, + prompts: Array.new(), + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -284,15 +388,21 @@ describe 'test method "_to_hash"' do instance = Freeclimb::TranscribeUtterance.new( action_url: "TS", + play_beep: true, + + privacy_for_logging: true, + privacy_for_recording: true, + prompts: Array.new(), + ) it 'returns action_url in the form of hash' do expect(instance._to_hash(instance.action_url)).to eq(instance.action_url) diff --git a/spec/models/transcribe_webhook_spec.rb b/spec/models/transcribe_webhook_spec.rb new file mode 100644 index 00000000..33d0a4d3 --- /dev/null +++ b/spec/models/transcribe_webhook_spec.rb @@ -0,0 +1,1373 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::TranscribeWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::TranscribeWebhook do + let(:instance) { Freeclimb::TranscribeWebhook.new } + + describe 'test an instance of TranscribeWebhook' do + it 'should create an instance of TranscribeWebhook' do + expect(instance).to be_instance_of(Freeclimb::TranscribeWebhook) + end + end + describe '.deserialize' do + it 'deserializes a json payload into instance of TranscribeWebhook' do + payload = '{ "requestType": "transcribe" }' + expect(Freeclimb::TranscribeWebhook.deserialize(payload)).to be_instance_of(Freeclimb::TranscribeWebhook) + end + end + + describe 'test attribute "request_type"' do + it 'should work' do + instance.request_type = "TEST_STRING" + expect(instance.request_type).to eq("TEST_STRING") + + end + end + + describe 'test attribute "account_id"' do + it 'should work' do + instance.account_id = "TEST_STRING" + expect(instance.account_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "call_id"' do + it 'should work' do + instance.call_id = "TEST_STRING" + expect(instance.call_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "from"' do + it 'should work' do + instance.from = "TEST_STRING" + expect(instance.from).to eq("TEST_STRING") + + end + end + + describe 'test attribute "to"' do + it 'should work' do + instance.to = "TEST_STRING" + expect(instance.to).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_id"' do + it 'should work' do + instance.recording_id = "TEST_STRING" + expect(instance.recording_id).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_url"' do + it 'should work' do + instance.recording_url = "TEST_STRING" + expect(instance.recording_url).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_size"' do + it 'should work' do + + + instance.recording_size = 1 + expect(instance.recording_size).to eq(1) + + end + end + + describe 'test attribute "recording_format"' do + it 'should work' do + instance.recording_format = "TEST_STRING" + expect(instance.recording_format).to eq("TEST_STRING") + + end + end + + describe 'test attribute "recording_duration_ms"' do + it 'should work' do + + + instance.recording_duration_ms = 1 + expect(instance.recording_duration_ms).to eq(1) + + end + end + + + describe 'test attribute "term_reason"' do + it 'assigns value ERROR' do + instance.term_reason = Freeclimb::TranscribeTermReason::ERROR + expect(instance.term_reason).to eq(Freeclimb::TranscribeTermReason::ERROR) + end + it 'assigns value COMPLETED' do + instance.term_reason = Freeclimb::TranscribeTermReason::COMPLETED + expect(instance.term_reason).to eq(Freeclimb::TranscribeTermReason::COMPLETED) + end + end + + describe 'test attribute "record_term_reason"' do + it 'assigns value FINISH_KEY' do + instance.record_term_reason = Freeclimb::RecordUtteranceTermReason::FINISH_KEY + expect(instance.record_term_reason).to eq(Freeclimb::RecordUtteranceTermReason::FINISH_KEY) + end + it 'assigns value TIMEOUT' do + instance.record_term_reason = Freeclimb::RecordUtteranceTermReason::TIMEOUT + expect(instance.record_term_reason).to eq(Freeclimb::RecordUtteranceTermReason::TIMEOUT) + end + it 'assigns value HANGUP' do + instance.record_term_reason = Freeclimb::RecordUtteranceTermReason::HANGUP + expect(instance.record_term_reason).to eq(Freeclimb::RecordUtteranceTermReason::HANGUP) + end + it 'assigns value MAX_LENGTH' do + instance.record_term_reason = Freeclimb::RecordUtteranceTermReason::MAX_LENGTH + expect(instance.record_term_reason).to eq(Freeclimb::RecordUtteranceTermReason::MAX_LENGTH) + end + end + describe 'test attribute "digit"' do + it 'should work' do + instance.digit = "TEST_STRING" + expect(instance.digit).to eq("TEST_STRING") + + end + end + + describe 'test attribute "privacy_for_logging"' do + it 'should work' do + instance.privacy_for_logging = false + expect(instance.privacy_for_logging).to eq(false) + + end + end + + describe 'test attribute "privacy_for_recording"' do + it 'should work' do + instance.privacy_for_recording = false + expect(instance.privacy_for_recording).to eq(false) + + end + end + + + describe 'test attribute "barge_in_reason"' do + it 'assigns value NO_BARGE_IN' do + instance.barge_in_reason = Freeclimb::BargeInReason::NO_BARGE_IN + expect(instance.barge_in_reason).to eq(Freeclimb::BargeInReason::NO_BARGE_IN) + end + it 'assigns value BARGE_IN_BY_DTMF' do + instance.barge_in_reason = Freeclimb::BargeInReason::BARGE_IN_BY_DTMF + expect(instance.barge_in_reason).to eq(Freeclimb::BargeInReason::BARGE_IN_BY_DTMF) + end + it 'assigns value BARGE_IN_BY_ENERGY' do + instance.barge_in_reason = Freeclimb::BargeInReason::BARGE_IN_BY_ENERGY + expect(instance.barge_in_reason).to eq(Freeclimb::BargeInReason::BARGE_IN_BY_ENERGY) + end + end + describe 'test attribute "barged_in_prompt_no"' do + it 'should work' do + + + instance.barged_in_prompt_no = 1 + expect(instance.barged_in_prompt_no).to eq(1) + + end + end + + describe 'test attribute "barged_in_prompt_ms"' do + it 'should work' do + + + instance.barged_in_prompt_ms = 1 + expect(instance.barged_in_prompt_ms).to eq(1) + + end + end + + describe 'test attribute "barged_in_prompt_loop_no"' do + it 'should work' do + + + instance.barged_in_prompt_loop_no = 1 + expect(instance.barged_in_prompt_loop_no).to eq(1) + + end + end + + describe 'test attribute "barge_in_time_ms"' do + it 'should work' do + + + instance.barge_in_time_ms = 1 + expect(instance.barge_in_time_ms).to eq(1) + + end + end + + describe 'test attribute "transcript"' do + it 'should work' do + instance.transcript = "TEST_STRING" + expect(instance.transcript).to eq("TEST_STRING") + + end + end + + + describe 'test attribute "transcribe_reason"' do + it 'assigns value INTERNAL_ERROR' do + instance.transcribe_reason = Freeclimb::TranscribeReason::INTERNAL_ERROR + expect(instance.transcribe_reason).to eq(Freeclimb::TranscribeReason::INTERNAL_ERROR) + end + it 'assigns value HANGUP' do + instance.transcribe_reason = Freeclimb::TranscribeReason::HANGUP + expect(instance.transcribe_reason).to eq(Freeclimb::TranscribeReason::HANGUP) + end + it 'assigns value MAX_LENGTH' do + instance.transcribe_reason = Freeclimb::TranscribeReason::MAX_LENGTH + expect(instance.transcribe_reason).to eq(Freeclimb::TranscribeReason::MAX_LENGTH) + end + it 'assigns value DIGIT' do + instance.transcribe_reason = Freeclimb::TranscribeReason::DIGIT + expect(instance.transcribe_reason).to eq(Freeclimb::TranscribeReason::DIGIT) + end + it 'assigns value NO_INPUT' do + instance.transcribe_reason = Freeclimb::TranscribeReason::NO_INPUT + expect(instance.transcribe_reason).to eq(Freeclimb::TranscribeReason::NO_INPUT) + end + end + describe 'test attribute "transcription_duration_ms"' do + it 'should work' do + + + instance.transcription_duration_ms = 1 + expect(instance.transcription_duration_ms).to eq(1) + + end + end + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::TranscribeWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: 1, + + recording_format: "TS", + + recording_duration_ms: 1, + + + term_reason: Freeclimb::TranscribeTermReason::ERROR, + + + record_term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + digit: "TS", + + privacy_for_logging: true, + + privacy_for_recording: true, + + + barge_in_reason: Freeclimb::BargeInReason::NO_BARGE_IN, + + barged_in_prompt_no: 1, + + barged_in_prompt_ms: 1, + + barged_in_prompt_loop_no: 1, + + barge_in_time_ms: 1, + + transcript: "TS", + + + transcribe_reason: Freeclimb::TranscribeReason::INTERNAL_ERROR, + + transcription_duration_ms: 1, + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::TranscribeWebhook' do + expect { instance = Freeclimb::TranscribeWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: 1, + + recording_format: "TS", + + recording_duration_ms: 1, + + + term_reason: Freeclimb::TranscribeTermReason::ERROR, + + + record_term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + digit: "TS", + + privacy_for_logging: true, + + privacy_for_recording: true, + + + barge_in_reason: Freeclimb::BargeInReason::NO_BARGE_IN, + + barged_in_prompt_no: 1, + + barged_in_prompt_ms: 1, + + barged_in_prompt_loop_no: 1, + + barge_in_time_ms: 1, + + transcript: "TS", + + + transcribe_reason: Freeclimb::TranscribeReason::INTERNAL_ERROR, + + transcription_duration_ms: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::TranscribeWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: 1, + + recording_format: "TS", + + recording_duration_ms: 1, + + + term_reason: Freeclimb::TranscribeTermReason::ERROR, + + + record_term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + digit: "TS", + + privacy_for_logging: true, + + privacy_for_recording: true, + + + barge_in_reason: Freeclimb::BargeInReason::NO_BARGE_IN, + + barged_in_prompt_no: 1, + + barged_in_prompt_ms: 1, + + barged_in_prompt_loop_no: 1, + + barge_in_time_ms: 1, + + transcript: "TS", + + + transcribe_reason: Freeclimb::TranscribeReason::INTERNAL_ERROR, + + transcription_duration_ms: 1, + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::TranscribeWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: 1, + + recording_format: "TS", + + recording_duration_ms: 1, + + + term_reason: Freeclimb::TranscribeTermReason::ERROR, + + + record_term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + digit: "TS", + + privacy_for_logging: true, + + privacy_for_recording: true, + + + barge_in_reason: Freeclimb::BargeInReason::NO_BARGE_IN, + + barged_in_prompt_no: 1, + + barged_in_prompt_ms: 1, + + barged_in_prompt_loop_no: 1, + + barge_in_time_ms: 1, + + transcript: "TS", + + + transcribe_reason: Freeclimb::TranscribeReason::INTERNAL_ERROR, + + transcription_duration_ms: 1, + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::TranscribeWebhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::TranscribeWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: 1, + + recording_format: "TS", + + recording_duration_ms: 1, + + + term_reason: Freeclimb::TranscribeTermReason::ERROR, + + + record_term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + digit: "TS", + + privacy_for_logging: true, + + privacy_for_recording: true, + + + barge_in_reason: Freeclimb::BargeInReason::NO_BARGE_IN, + + barged_in_prompt_no: 1, + + barged_in_prompt_ms: 1, + + barged_in_prompt_loop_no: 1, + + barge_in_time_ms: 1, + + transcript: "TS", + + + transcribe_reason: Freeclimb::TranscribeReason::INTERNAL_ERROR, + + transcription_duration_ms: 1, + + ) + instance_2 = Freeclimb::TranscribeWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: 1, + + recording_format: "TS", + + recording_duration_ms: 1, + + + term_reason: Freeclimb::TranscribeTermReason::ERROR, + + + record_term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + digit: "TS", + + privacy_for_logging: true, + + privacy_for_recording: true, + + + barge_in_reason: Freeclimb::BargeInReason::NO_BARGE_IN, + + barged_in_prompt_no: 1, + + barged_in_prompt_ms: 1, + + barged_in_prompt_loop_no: 1, + + barge_in_time_ms: 1, + + transcript: "TS", + + + transcribe_reason: Freeclimb::TranscribeReason::INTERNAL_ERROR, + + transcription_duration_ms: 1, + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::TranscribeWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: 2, + + recording_format: "TS", + + recording_duration_ms: 2, + + + term_reason: Freeclimb::TranscribeTermReason::ERROR, + + + record_term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + digit: "TS", + + privacy_for_logging: true, + + privacy_for_recording: true, + + + barge_in_reason: Freeclimb::BargeInReason::NO_BARGE_IN, + + barged_in_prompt_no: 2, + + barged_in_prompt_ms: 2, + + barged_in_prompt_loop_no: 2, + + barge_in_time_ms: 2, + + transcript: "TS", + + + transcribe_reason: Freeclimb::TranscribeReason::INTERNAL_ERROR, + + transcription_duration_ms: 2, + + ) + instance_2 = Freeclimb::TranscribeWebhook.new( + request_type: "ST", + + account_id: "ST", + + call_id: "ST", + + from: "ST", + + to: "ST", + + recording_id: "ST", + + recording_url: "ST", + + recording_size: 1, + + recording_format: "ST", + + recording_duration_ms: 1, + + + term_reason: nil, + + + record_term_reason: nil, + + digit: "ST", + + privacy_for_logging: false, + + privacy_for_recording: false, + + + barge_in_reason: nil, + + barged_in_prompt_no: 1, + + barged_in_prompt_ms: 1, + + barged_in_prompt_loop_no: 1, + + barge_in_time_ms: 1, + + transcript: "ST", + + + transcribe_reason: nil, + + transcription_duration_ms: 1, + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::TranscribeWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: 1, + + recording_format: "TS", + + recording_duration_ms: 1, + + + term_reason: Freeclimb::TranscribeTermReason::ERROR, + + + record_term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + digit: "TS", + + privacy_for_logging: true, + + privacy_for_recording: true, + + + barge_in_reason: Freeclimb::BargeInReason::NO_BARGE_IN, + + barged_in_prompt_no: 1, + + barged_in_prompt_ms: 1, + + barged_in_prompt_loop_no: 1, + + barge_in_time_ms: 1, + + transcript: "TS", + + + transcribe_reason: Freeclimb::TranscribeReason::INTERNAL_ERROR, + + transcription_duration_ms: 1, + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::TranscribeWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: 1, + + recording_format: "TS", + + recording_duration_ms: 1, + + + term_reason: Freeclimb::TranscribeTermReason::ERROR, + + + record_term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + digit: "TS", + + privacy_for_logging: true, + + privacy_for_recording: true, + + + barge_in_reason: Freeclimb::BargeInReason::NO_BARGE_IN, + + barged_in_prompt_no: 1, + + barged_in_prompt_ms: 1, + + barged_in_prompt_loop_no: 1, + + barge_in_time_ms: 1, + + transcript: "TS", + + + transcribe_reason: Freeclimb::TranscribeReason::INTERNAL_ERROR, + + transcription_duration_ms: 1, + + ) + instance_2 = Freeclimb::TranscribeWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: 1, + + recording_format: "TS", + + recording_duration_ms: 1, + + + term_reason: Freeclimb::TranscribeTermReason::ERROR, + + + record_term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + digit: "TS", + + privacy_for_logging: true, + + privacy_for_recording: true, + + + barge_in_reason: Freeclimb::BargeInReason::NO_BARGE_IN, + + barged_in_prompt_no: 1, + + barged_in_prompt_ms: 1, + + barged_in_prompt_loop_no: 1, + + barge_in_time_ms: 1, + + transcript: "TS", + + + transcribe_reason: Freeclimb::TranscribeReason::INTERNAL_ERROR, + + transcription_duration_ms: 1, + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::TranscribeWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: 1, + + recording_format: "TS", + + recording_duration_ms: 1, + + + term_reason: Freeclimb::TranscribeTermReason::ERROR, + + + record_term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + digit: "TS", + + privacy_for_logging: true, + + privacy_for_recording: true, + + + barge_in_reason: Freeclimb::BargeInReason::NO_BARGE_IN, + + barged_in_prompt_no: 1, + + barged_in_prompt_ms: 1, + + barged_in_prompt_loop_no: 1, + + barge_in_time_ms: 1, + + transcript: "TS", + + + transcribe_reason: Freeclimb::TranscribeReason::INTERNAL_ERROR, + + transcription_duration_ms: 1, + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + it 'deserializes the data of account_id' do + expect(instance._deserialize("String", instance.account_id)).to be_a_kind_of(String) + end + it 'deserializes the data of call_id' do + expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) + end + it 'deserializes the data of from' do + expect(instance._deserialize("String", instance.from)).to be_a_kind_of(String) + end + it 'deserializes the data of to' do + expect(instance._deserialize("String", instance.to)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_id' do + expect(instance._deserialize("String", instance.recording_id)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_url' do + expect(instance._deserialize("String", instance.recording_url)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_size' do + expect(instance._deserialize("Integer", instance.recording_size)).to be_a_kind_of(Integer) + end + it 'deserializes the data of recording_format' do + expect(instance._deserialize("String", instance.recording_format)).to be_a_kind_of(String) + end + it 'deserializes the data of recording_duration_ms' do + expect(instance._deserialize("Integer", instance.recording_duration_ms)).to be_a_kind_of(Integer) + end + it 'deserializes the data of digit' do + expect(instance._deserialize("String", instance.digit)).to be_a_kind_of(String) + end + it 'deserializes the data of privacy_for_logging' do + expect(instance._deserialize("Boolean", instance.privacy_for_logging)).to be_a_kind_of(TrueClass) + end + it 'deserializes the data of privacy_for_recording' do + expect(instance._deserialize("Boolean", instance.privacy_for_recording)).to be_a_kind_of(TrueClass) + end + it 'deserializes the data of barged_in_prompt_no' do + expect(instance._deserialize("Integer", instance.barged_in_prompt_no)).to be_a_kind_of(Integer) + end + it 'deserializes the data of barged_in_prompt_ms' do + expect(instance._deserialize("Integer", instance.barged_in_prompt_ms)).to be_a_kind_of(Integer) + end + it 'deserializes the data of barged_in_prompt_loop_no' do + expect(instance._deserialize("Integer", instance.barged_in_prompt_loop_no)).to be_a_kind_of(Integer) + end + it 'deserializes the data of barge_in_time_ms' do + expect(instance._deserialize("Integer", instance.barge_in_time_ms)).to be_a_kind_of(Integer) + end + it 'deserializes the data of transcript' do + expect(instance._deserialize("String", instance.transcript)).to be_a_kind_of(String) + end + it 'deserializes the data of transcription_duration_ms' do + expect(instance._deserialize("Integer", instance.transcription_duration_ms)).to be_a_kind_of(Integer) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::TranscribeWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: 1, + + recording_format: "TS", + + recording_duration_ms: 1, + + + term_reason: Freeclimb::TranscribeTermReason::ERROR, + + + record_term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + digit: "TS", + + privacy_for_logging: true, + + privacy_for_recording: true, + + + barge_in_reason: Freeclimb::BargeInReason::NO_BARGE_IN, + + barged_in_prompt_no: 1, + + barged_in_prompt_ms: 1, + + barged_in_prompt_loop_no: 1, + + barge_in_time_ms: 1, + + transcript: "TS", + + + transcribe_reason: Freeclimb::TranscribeReason::INTERNAL_ERROR, + + transcription_duration_ms: 1, + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::TranscribeWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: 1, + + recording_format: "TS", + + recording_duration_ms: 1, + + + term_reason: Freeclimb::TranscribeTermReason::ERROR, + + + record_term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + digit: "TS", + + privacy_for_logging: true, + + privacy_for_recording: true, + + + barge_in_reason: Freeclimb::BargeInReason::NO_BARGE_IN, + + barged_in_prompt_no: 1, + + barged_in_prompt_ms: 1, + + barged_in_prompt_loop_no: 1, + + barge_in_time_ms: 1, + + transcript: "TS", + + + transcribe_reason: Freeclimb::TranscribeReason::INTERNAL_ERROR, + + transcription_duration_ms: 1, + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::TranscribeWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: 1, + + recording_format: "TS", + + recording_duration_ms: 1, + + + term_reason: Freeclimb::TranscribeTermReason::ERROR, + + + record_term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + digit: "TS", + + privacy_for_logging: true, + + privacy_for_recording: true, + + + barge_in_reason: Freeclimb::BargeInReason::NO_BARGE_IN, + + barged_in_prompt_no: 1, + + barged_in_prompt_ms: 1, + + barged_in_prompt_loop_no: 1, + + barge_in_time_ms: 1, + + transcript: "TS", + + + transcribe_reason: Freeclimb::TranscribeReason::INTERNAL_ERROR, + + transcription_duration_ms: 1, + + ) + instance_2 = Freeclimb::TranscribeWebhook.new( + request_type: "TS", + + account_id: "TS", + + call_id: "TS", + + from: "TS", + + to: "TS", + + recording_id: "TS", + + recording_url: "TS", + + recording_size: 1, + + recording_format: "TS", + + recording_duration_ms: 1, + + + term_reason: Freeclimb::TranscribeTermReason::ERROR, + + + record_term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + digit: "TS", + + privacy_for_logging: true, + + privacy_for_recording: true, + + + barge_in_reason: Freeclimb::BargeInReason::NO_BARGE_IN, + + barged_in_prompt_no: 1, + + barged_in_prompt_ms: 1, + + barged_in_prompt_loop_no: 1, + + barge_in_time_ms: 1, + + transcript: "TS", + + + transcribe_reason: Freeclimb::TranscribeReason::INTERNAL_ERROR, + + transcription_duration_ms: 1, + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::TranscribeWebhook.new( + request_type: "TS", + + + account_id: "TS", + + + call_id: "TS", + + + from: "TS", + + + to: "TS", + + + recording_id: "TS", + + + recording_url: "TS", + + + recording_size: 1, + + + recording_format: "TS", + + + recording_duration_ms: 1, + + + + term_reason: Freeclimb::TranscribeTermReason::ERROR, + + + + record_term_reason: Freeclimb::RecordUtteranceTermReason::FINISH_KEY, + + + digit: "TS", + + + privacy_for_logging: true, + + + privacy_for_recording: true, + + + + barge_in_reason: Freeclimb::BargeInReason::NO_BARGE_IN, + + + barged_in_prompt_no: 1, + + + barged_in_prompt_ms: 1, + + + barged_in_prompt_loop_no: 1, + + + barge_in_time_ms: 1, + + + transcript: "TS", + + + + transcribe_reason: Freeclimb::TranscribeReason::INTERNAL_ERROR, + + + transcription_duration_ms: 1, + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + it 'returns account_id in the form of hash' do + expect(instance._to_hash(instance.account_id)).to eq(instance.account_id) + end + it 'returns call_id in the form of hash' do + expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) + end + it 'returns from in the form of hash' do + expect(instance._to_hash(instance.from)).to eq(instance.from) + end + it 'returns to in the form of hash' do + expect(instance._to_hash(instance.to)).to eq(instance.to) + end + it 'returns recording_id in the form of hash' do + expect(instance._to_hash(instance.recording_id)).to eq(instance.recording_id) + end + it 'returns recording_url in the form of hash' do + expect(instance._to_hash(instance.recording_url)).to eq(instance.recording_url) + end + it 'returns recording_size in the form of hash' do + expect(instance._to_hash(instance.recording_size)).to eq(instance.recording_size) + end + it 'returns recording_format in the form of hash' do + expect(instance._to_hash(instance.recording_format)).to eq(instance.recording_format) + end + it 'returns recording_duration_ms in the form of hash' do + expect(instance._to_hash(instance.recording_duration_ms)).to eq(instance.recording_duration_ms) + end + it 'returns term_reason in the form of hash' do + expect(instance._to_hash(instance.term_reason)).to eq(instance.term_reason) + end + it 'returns record_term_reason in the form of hash' do + expect(instance._to_hash(instance.record_term_reason)).to eq(instance.record_term_reason) + end + it 'returns digit in the form of hash' do + expect(instance._to_hash(instance.digit)).to eq(instance.digit) + end + it 'returns privacy_for_logging in the form of hash' do + expect(instance._to_hash(instance.privacy_for_logging)).to eq(instance.privacy_for_logging) + end + it 'returns privacy_for_recording in the form of hash' do + expect(instance._to_hash(instance.privacy_for_recording)).to eq(instance.privacy_for_recording) + end + it 'returns barge_in_reason in the form of hash' do + expect(instance._to_hash(instance.barge_in_reason)).to eq(instance.barge_in_reason) + end + it 'returns barged_in_prompt_no in the form of hash' do + expect(instance._to_hash(instance.barged_in_prompt_no)).to eq(instance.barged_in_prompt_no) + end + it 'returns barged_in_prompt_ms in the form of hash' do + expect(instance._to_hash(instance.barged_in_prompt_ms)).to eq(instance.barged_in_prompt_ms) + end + it 'returns barged_in_prompt_loop_no in the form of hash' do + expect(instance._to_hash(instance.barged_in_prompt_loop_no)).to eq(instance.barged_in_prompt_loop_no) + end + it 'returns barge_in_time_ms in the form of hash' do + expect(instance._to_hash(instance.barge_in_time_ms)).to eq(instance.barge_in_time_ms) + end + it 'returns transcript in the form of hash' do + expect(instance._to_hash(instance.transcript)).to eq(instance.transcript) + end + it 'returns transcribe_reason in the form of hash' do + expect(instance._to_hash(instance.transcribe_reason)).to eq(instance.transcribe_reason) + end + it 'returns transcription_duration_ms in the form of hash' do + expect(instance._to_hash(instance.transcription_duration_ms)).to eq(instance.transcription_duration_ms) + end + end + +end diff --git a/spec/models/unpark_spec.rb b/spec/models/unpark_spec.rb index db7cd8e0..68d62329 100644 --- a/spec/models/unpark_spec.rb +++ b/spec/models/unpark_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/update_call_request_spec.rb b/spec/models/update_call_request_spec.rb index 42a8de4c..b5e01339 100644 --- a/spec/models/update_call_request_spec.rb +++ b/spec/models/update_call_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -37,31 +37,38 @@ expect(instance.status).to eq(Freeclimb::UpdateCallRequestStatus::COMPLETED) end end - describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::UpdateCallRequest.new( - status: "CANCELED", - )}.not_to raise_error() + expect { instance = Freeclimb::UpdateCallRequest.new( + + status: Freeclimb::UpdateCallRequestStatus::CANCELED, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::UpdateCallRequest' do - expect{instance = Freeclimb::UpdateCallRequest.new( - status: "CANCELED", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::UpdateCallRequest.new( + + status: Freeclimb::UpdateCallRequestStatus::CANCELED, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::UpdateCallRequest.new( - status: "CANCELED", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::UpdateCallRequest.new( + + status: Freeclimb::UpdateCallRequestStatus::CANCELED, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end describe 'test method "valid"' do it 'checks if properties are valid' do instance = Freeclimb::UpdateCallRequest.new( - status: "CANCELED", + + status: Freeclimb::UpdateCallRequestStatus::CANCELED, + ) expect(instance.valid?).to eq(true) end @@ -80,24 +87,28 @@ it 'checks if objects are equal' do obj = Object.new() instance_1 = Freeclimb::UpdateCallRequest.new( - status: Freeclimb::UpdateCallRequestStatus.new(), - status: "CANCELED", + + status: Freeclimb::UpdateCallRequestStatus::CANCELED, + ) instance_2 = Freeclimb::UpdateCallRequest.new( - status: Freeclimb::UpdateCallRequestStatus.new(), - status: "CANCELED", + + status: Freeclimb::UpdateCallRequestStatus::CANCELED, + ) expect(instance_1.eql?(instance_2)).to eq(true) end it 'checks if objects are not equal' do instance_1 = Freeclimb::UpdateCallRequest.new( - status: Freeclimb::UpdateCallRequestStatus.new(), - status: "CANCELED", + + status: Freeclimb::UpdateCallRequestStatus::CANCELED, + ) instance_2 = Freeclimb::UpdateCallRequest.new( - status: Freeclimb::UpdateCallRequestStatus.new(), - status: "COMPLETED", + + status: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -106,32 +117,45 @@ describe 'test method "hash"' do it 'calculates hash code' do instance = Freeclimb::UpdateCallRequest.new( - status: "CANCELED", + + status: Freeclimb::UpdateCallRequestStatus::CANCELED, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end describe 'test method "build_from_hash"' do it 'builds equivalent model from hash code' do instance_1 = Freeclimb::UpdateCallRequest.new( - status: "CANCELED", + + status: Freeclimb::UpdateCallRequestStatus::CANCELED, + + ) + instance_2 = Freeclimb::UpdateCallRequest.new( + + status: Freeclimb::UpdateCallRequestStatus::CANCELED, + ) - instance_2 = Freeclimb::UpdateCallRequest.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end describe 'test method "_deserialize"' do instance = Freeclimb::UpdateCallRequest.new( - status: "CANCELED", + + status: Freeclimb::UpdateCallRequestStatus::CANCELED, + ) end describe 'test method "to_s"' do it 'returns the string representation of the object' do instance = Freeclimb::UpdateCallRequest.new( - status: "CANCELED", + + status: Freeclimb::UpdateCallRequestStatus::CANCELED, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -140,17 +164,23 @@ describe 'test method "to_hash"' do it 'returns the object in the form of hash' do instance = Freeclimb::UpdateCallRequest.new( - status: "CANCELED", + + status: Freeclimb::UpdateCallRequestStatus::CANCELED, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end it 'creates equal hash for two equal objects' do obj = Object.new() instance_1 = Freeclimb::UpdateCallRequest.new( - status: "CANCELED", + + status: Freeclimb::UpdateCallRequestStatus::CANCELED, + ) instance_2 = Freeclimb::UpdateCallRequest.new( - status: "CANCELED", + + status: Freeclimb::UpdateCallRequestStatus::CANCELED, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -158,7 +188,9 @@ describe 'test method "_to_hash"' do instance = Freeclimb::UpdateCallRequest.new( - status: "CANCELED", + + status: Freeclimb::UpdateCallRequestStatus::CANCELED, + ) it 'returns status in the form of hash' do expect(instance._to_hash(instance.status)).to eq(instance.status) diff --git a/spec/models/update_call_request_status_spec.rb b/spec/models/update_call_request_status_spec.rb index 56073c30..77ba6e06 100644 --- a/spec/models/update_call_request_status_spec.rb +++ b/spec/models/update_call_request_status_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/update_conference_participant_request_spec.rb b/spec/models/update_conference_participant_request_spec.rb index a4104d5f..348bd137 100644 --- a/spec/models/update_conference_participant_request_spec.rb +++ b/spec/models/update_conference_participant_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -42,26 +42,46 @@ end end + describe 'test attribute "dtmf_pass_through"' do + it 'should work' do + instance.dtmf_pass_through = false + expect(instance.dtmf_pass_through).to eq(false) + + end + end + describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::UpdateConferenceParticipantRequest.new( - talk: true, - listen: true, - )}.not_to raise_error() + expect { instance = Freeclimb::UpdateConferenceParticipantRequest.new( + talk: true, + + listen: true, + + dtmf_pass_through: true, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::UpdateConferenceParticipantRequest' do - expect{instance = Freeclimb::UpdateConferenceParticipantRequest.new( - talk: true, - listen: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::UpdateConferenceParticipantRequest.new( + talk: true, + + listen: true, + + dtmf_pass_through: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::UpdateConferenceParticipantRequest.new( - talk: true, - listen: true, - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::UpdateConferenceParticipantRequest.new( + talk: true, + + listen: true, + + dtmf_pass_through: true, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -69,7 +89,11 @@ it 'checks if properties are valid' do instance = Freeclimb::UpdateConferenceParticipantRequest.new( talk: true, + listen: true, + + dtmf_pass_through: true, + ) expect(instance.valid?).to eq(true) end @@ -89,11 +113,19 @@ obj = Object.new() instance_1 = Freeclimb::UpdateConferenceParticipantRequest.new( talk: true, + listen: true, + + dtmf_pass_through: true, + ) instance_2 = Freeclimb::UpdateConferenceParticipantRequest.new( talk: true, + listen: true, + + dtmf_pass_through: true, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -101,11 +133,19 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::UpdateConferenceParticipantRequest.new( talk: true, + listen: true, + + dtmf_pass_through: true, + ) instance_2 = Freeclimb::UpdateConferenceParticipantRequest.new( talk: false, + listen: false, + + dtmf_pass_through: false, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -115,9 +155,13 @@ it 'calculates hash code' do instance = Freeclimb::UpdateConferenceParticipantRequest.new( talk: true, + listen: true, + + dtmf_pass_through: true, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -125,9 +169,21 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::UpdateConferenceParticipantRequest.new( talk: true, + listen: true, + + dtmf_pass_through: true, + + ) + instance_2 = Freeclimb::UpdateConferenceParticipantRequest.new( + talk: true, + + listen: true, + + dtmf_pass_through: true, + ) - instance_2 = Freeclimb::UpdateConferenceParticipantRequest.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -135,7 +191,11 @@ describe 'test method "_deserialize"' do instance = Freeclimb::UpdateConferenceParticipantRequest.new( talk: true, + listen: true, + + dtmf_pass_through: true, + ) it 'deserializes the data of talk' do expect(instance._deserialize("Boolean", instance.talk)).to be_a_kind_of(TrueClass) @@ -143,13 +203,20 @@ it 'deserializes the data of listen' do expect(instance._deserialize("Boolean", instance.listen)).to be_a_kind_of(TrueClass) end + it 'deserializes the data of dtmf_pass_through' do + expect(instance._deserialize("Boolean", instance.dtmf_pass_through)).to be_a_kind_of(TrueClass) + end end describe 'test method "to_s"' do it 'returns the string representation of the object' do instance = Freeclimb::UpdateConferenceParticipantRequest.new( talk: true, + listen: true, + + dtmf_pass_through: true, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -159,7 +226,11 @@ it 'returns the object in the form of hash' do instance = Freeclimb::UpdateConferenceParticipantRequest.new( talk: true, + listen: true, + + dtmf_pass_through: true, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -167,11 +238,19 @@ obj = Object.new() instance_1 = Freeclimb::UpdateConferenceParticipantRequest.new( talk: true, + listen: true, + + dtmf_pass_through: true, + ) instance_2 = Freeclimb::UpdateConferenceParticipantRequest.new( talk: true, + listen: true, + + dtmf_pass_through: true, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -180,8 +259,13 @@ describe 'test method "_to_hash"' do instance = Freeclimb::UpdateConferenceParticipantRequest.new( talk: true, + listen: true, + + + dtmf_pass_through: true, + ) it 'returns talk in the form of hash' do expect(instance._to_hash(instance.talk)).to eq(instance.talk) @@ -189,6 +273,9 @@ it 'returns listen in the form of hash' do expect(instance._to_hash(instance.listen)).to eq(instance.listen) end + it 'returns dtmf_pass_through in the form of hash' do + expect(instance._to_hash(instance.dtmf_pass_through)).to eq(instance.dtmf_pass_through) + end end end diff --git a/spec/models/update_conference_request_spec.rb b/spec/models/update_conference_request_spec.rb index 160d5c0f..3adb39ae 100644 --- a/spec/models/update_conference_request_spec.rb +++ b/spec/models/update_conference_request_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end @@ -54,7 +54,6 @@ end end - describe 'test attribute "status"' do it 'assigns value EMPTY' do instance.status = Freeclimb::UpdateConferenceRequestStatus::EMPTY @@ -65,30 +64,44 @@ expect(instance.status).to eq(Freeclimb::UpdateConferenceRequestStatus::TERMINATED) end end - describe 'test method "initialize"' do it 'properly initializes with values' do - expect{instance = Freeclimb::UpdateConferenceRequest.new( - _alias: "TS", - play_beep: "ALWAYS", - status: "EMPTY", - )}.not_to raise_error() + expect { instance = Freeclimb::UpdateConferenceRequest.new( + _alias: "TS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + + status: Freeclimb::UpdateConferenceRequestStatus::EMPTY, + + )}.not_to raise_error() end it 'fails to initialize with input argument that is not a hash in Freeclimb::UpdateConferenceRequest' do - expect{instance = Freeclimb::UpdateConferenceRequest.new( - _alias: "TS", - play_beep: "ALWAYS", - status: "EMPTY", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::UpdateConferenceRequest.new( + _alias: "TS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + + status: Freeclimb::UpdateConferenceRequestStatus::EMPTY, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end it 'fails to initialize with invalid attribute' do - expect{instance = Freeclimb::UpdateConferenceRequest.new( - _alias: "TS", - play_beep: "ALWAYS", - status: "EMPTY", - invalid_attribute: true - )}.to raise_error(ArgumentError) + expect { instance = Freeclimb::UpdateConferenceRequest.new( + _alias: "TS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + + status: Freeclimb::UpdateConferenceRequestStatus::EMPTY, + + invalid_attribute: true + )}.to raise_error(ArgumentError) end end @@ -96,8 +109,13 @@ it 'checks if properties are valid' do instance = Freeclimb::UpdateConferenceRequest.new( _alias: "TS", - play_beep: "ALWAYS", - status: "EMPTY", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + + status: Freeclimb::UpdateConferenceRequestStatus::EMPTY, + ) expect(instance.valid?).to eq(true) end @@ -117,17 +135,23 @@ obj = Object.new() instance_1 = Freeclimb::UpdateConferenceRequest.new( _alias: "TS", - play_beep: Freeclimb::PlayBeep.new(), - play_beep: "ALWAYS", - status: Freeclimb::UpdateConferenceRequestStatus.new(), - status: "EMPTY", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + + status: Freeclimb::UpdateConferenceRequestStatus::EMPTY, + ) instance_2 = Freeclimb::UpdateConferenceRequest.new( _alias: "TS", - play_beep: Freeclimb::PlayBeep.new(), - play_beep: "ALWAYS", - status: Freeclimb::UpdateConferenceRequestStatus.new(), - status: "EMPTY", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + + status: Freeclimb::UpdateConferenceRequestStatus::EMPTY, + ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -135,17 +159,23 @@ it 'checks if objects are not equal' do instance_1 = Freeclimb::UpdateConferenceRequest.new( _alias: "TS", - play_beep: Freeclimb::PlayBeep.new(), - play_beep: "ALWAYS", - status: Freeclimb::UpdateConferenceRequestStatus.new(), - status: "EMPTY", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + + status: Freeclimb::UpdateConferenceRequestStatus::EMPTY, + ) instance_2 = Freeclimb::UpdateConferenceRequest.new( _alias: "ST", - play_beep: Freeclimb::PlayBeep.new(), - play_beep: "NEVER", - status: Freeclimb::UpdateConferenceRequestStatus.new(), - status: "TERMINATED", + + + play_beep: nil, + + + status: nil, + ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -155,10 +185,15 @@ it 'calculates hash code' do instance = Freeclimb::UpdateConferenceRequest.new( _alias: "TS", - play_beep: "ALWAYS", - status: "EMPTY", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + + status: Freeclimb::UpdateConferenceRequestStatus::EMPTY, + ) - expect(instance.hash).to be_a_kind_of(Integer) + expect(instance.hash).to be_a_kind_of(Integer) end end @@ -166,10 +201,25 @@ it 'builds equivalent model from hash code' do instance_1 = Freeclimb::UpdateConferenceRequest.new( _alias: "TS", - play_beep: "ALWAYS", - status: "EMPTY", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + + status: Freeclimb::UpdateConferenceRequestStatus::EMPTY, + + ) + instance_2 = Freeclimb::UpdateConferenceRequest.new( + _alias: "TS", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + + status: Freeclimb::UpdateConferenceRequestStatus::EMPTY, + ) - instance_2 = Freeclimb::UpdateConferenceRequest.new + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) end end @@ -177,8 +227,13 @@ describe 'test method "_deserialize"' do instance = Freeclimb::UpdateConferenceRequest.new( _alias: "TS", - play_beep: "ALWAYS", - status: "EMPTY", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + + status: Freeclimb::UpdateConferenceRequestStatus::EMPTY, + ) it 'deserializes the data of _alias' do expect(instance._deserialize("String", instance._alias)).to be_a_kind_of(String) @@ -189,8 +244,13 @@ it 'returns the string representation of the object' do instance = Freeclimb::UpdateConferenceRequest.new( _alias: "TS", - play_beep: "ALWAYS", - status: "EMPTY", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + + status: Freeclimb::UpdateConferenceRequestStatus::EMPTY, + ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -200,8 +260,13 @@ it 'returns the object in the form of hash' do instance = Freeclimb::UpdateConferenceRequest.new( _alias: "TS", - play_beep: "ALWAYS", - status: "EMPTY", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + + status: Freeclimb::UpdateConferenceRequestStatus::EMPTY, + ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -209,13 +274,23 @@ obj = Object.new() instance_1 = Freeclimb::UpdateConferenceRequest.new( _alias: "TS", - play_beep: "ALWAYS", - status: "EMPTY", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + + status: Freeclimb::UpdateConferenceRequestStatus::EMPTY, + ) instance_2 = Freeclimb::UpdateConferenceRequest.new( _alias: "TS", - play_beep: "ALWAYS", - status: "EMPTY", + + + play_beep: Freeclimb::PlayBeep::ALWAYS, + + + status: Freeclimb::UpdateConferenceRequestStatus::EMPTY, + ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -224,10 +299,15 @@ describe 'test method "_to_hash"' do instance = Freeclimb::UpdateConferenceRequest.new( _alias: "TS", + - play_beep: "ALWAYS", + + play_beep: Freeclimb::PlayBeep::ALWAYS, + - status: "EMPTY", + + status: Freeclimb::UpdateConferenceRequestStatus::EMPTY, + ) it 'returns _alias in the form of hash' do expect(instance._to_hash(instance._alias)).to eq(instance._alias) diff --git a/spec/models/update_conference_request_status_spec.rb b/spec/models/update_conference_request_status_spec.rb index 9178bc58..f2b4b326 100644 --- a/spec/models/update_conference_request_status_spec.rb +++ b/spec/models/update_conference_request_status_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/models/webhook_spec.rb b/spec/models/webhook_spec.rb new file mode 100644 index 00000000..65ebe77b --- /dev/null +++ b/spec/models/webhook_spec.rb @@ -0,0 +1,176 @@ +=begin +#FreeClimb API + +#FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request. + +The version of the OpenAPI document: 1.0.0 +Contact: support@freeclimb.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 7.9.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Freeclimb::Webhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::Webhook do + let(:instance) { Freeclimb::Webhook.new } + + describe 'test an instance of Webhook' do + it 'should create an instance of Webhook' do + expect(instance).to be_instance_of(Freeclimb::Webhook) + end + end + + + describe 'test method "initialize"' do + it 'properly initializes with values' do + expect { instance = Freeclimb::Webhook.new( + request_type: "TS", + + )}.not_to raise_error() + end + it 'fails to initialize with input argument that is not a hash in Freeclimb::Webhook' do + expect { instance = Freeclimb::Webhook.new( + request_type: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + it 'fails to initialize with invalid attribute' do + expect { instance = Freeclimb::Webhook.new( + request_type: "TS", + + invalid_attribute: true + )}.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it 'checks if properties are valid' do + instance = Freeclimb::Webhook.new( + request_type: "TS", + + ) + expect(instance.valid?).to eq(true) + end + + + skip 'checks if properties are invalid' do + instance = Freeclimb::Webhook.new( + + ) + expect(instance.valid?).to eq(false) + end + + end + + describe 'test method "eql?"' do + it 'checks if objects are equal' do + obj = Object.new() + instance_1 = Freeclimb::Webhook.new( + request_type: "TS", + + ) + instance_2 = Freeclimb::Webhook.new( + request_type: "TS", + + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it 'checks if objects are not equal' do + instance_1 = Freeclimb::Webhook.new( + request_type: "TS", + + ) + instance_2 = Freeclimb::Webhook.new( + request_type: "ST", + + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it 'calculates hash code' do + instance = Freeclimb::Webhook.new( + request_type: "TS", + + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it 'builds equivalent model from hash code' do + instance_1 = Freeclimb::Webhook.new( + request_type: "TS", + + ) + instance_2 = Freeclimb::Webhook.new( + request_type: "TS", + + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::Webhook.new( + request_type: "TS", + + ) + it 'deserializes the data of request_type' do + expect(instance._deserialize("String", instance.request_type)).to be_a_kind_of(String) + end + end + + describe 'test method "to_s"' do + it 'returns the string representation of the object' do + instance = Freeclimb::Webhook.new( + request_type: "TS", + + ) + expect(instance.to_s).to eq(instance.to_hash.to_s) + end + end + + describe 'test method "to_hash"' do + it 'returns the object in the form of hash' do + instance = Freeclimb::Webhook.new( + request_type: "TS", + + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it 'creates equal hash for two equal objects' do + obj = Object.new() + instance_1 = Freeclimb::Webhook.new( + request_type: "TS", + + ) + instance_2 = Freeclimb::Webhook.new( + request_type: "TS", + + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::Webhook.new( + request_type: "TS", + + ) + it 'returns request_type in the form of hash' do + expect(instance._to_hash(instance.request_type)).to eq(instance.request_type) + end + end + +end diff --git a/spec/quickstart_spec.rb b/spec/quickstart_spec.rb index da536fe1..d82f6560 100644 --- a/spec/quickstart_spec.rb +++ b/spec/quickstart_spec.rb @@ -1,11 +1,11 @@ require 'json' describe "quickstart" do - it "generates percl to say the text 'Hello, World!'" do - say = Freeclimb::Say.new(text:'Hello, World!') - get_speech = Freeclimb::GetSpeech.new(action_url: 'https://example.com/update') - script = Freeclimb::PerclScript.new(commands:[say, get_speech]) - json = script.to_json() - expect(json).to eq("[{\"Say\":{\"text\":\"Hello, World!\",\"loop\":1}},{\"GetSpeech\":{\"actionUrl\":\"https://example.com/update\"}}]") - end + it "generates percl to say the text 'Hello, World!'" do + say = Freeclimb::Say.new(text: 'Hello, World!') + get_speech = Freeclimb::GetSpeech.new(action_url: 'https://example.com/update') + script = Freeclimb::PerclScript.new(commands: [say, get_speech]) + json = script.to_json() + expect(json).to eq("[{\"Say\":{\"text\":\"Hello, World!\",\"loop\":1}},{\"GetSpeech\":{\"actionUrl\":\"https://example.com/update\"}}]") + end end \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 86ae2a87..0f9aef00 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Contact: support@freeclimb.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.4.0 +OpenAPI Generator version: 7.9.0 =end diff --git a/spec/utils/request_verifier_spec.rb b/spec/utils/request_verifier_spec.rb index e3edebc6..07a13c46 100644 --- a/spec/utils/request_verifier_spec.rb +++ b/spec/utils/request_verifier_spec.rb @@ -1,149 +1,149 @@ require 'spec_helper' describe 'RequestVerifier' do - before do - @request_verifier_object = Freeclimb::RequestVerifier.new() - end + before do + @request_verifier_object = Freeclimb::RequestVerifier.new() + end - describe '#check_request_body' do - context 'Request Body is empty' do - it 'throws "Request Body cannot be empty or null"' do - request_header = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" - signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" - tolerance = 5 * 60 - request_body = "" - expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Request Body cannot be empty or null") - end - end - context 'Request Body is nil' do - it 'throws "Request Body cannot be empty or null"' do - request_header = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" - signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" - tolerance = 5 * 60 - request_body = nil - expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Request Body cannot be empty or null") - end + describe '#check_request_body' do + context 'Request Body is empty' do + it 'throws "Request Body cannot be empty or null"' do + request_header = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" + signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" + tolerance = 5 * 60 + request_body = "" + expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Request Body cannot be empty or null") end end + context 'Request Body is nil' do + it 'throws "Request Body cannot be empty or null"' do + request_header = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" + signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" + tolerance = 5 * 60 + request_body = nil + expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Request Body cannot be empty or null") + end + end + end - describe '#check_request_header' do - context 'signatures are not present' do - it 'throws "Error with request header, signatures are not present"' do - request_header = "t=1679944186," - signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" - tolerance = 5 * 60 - request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" - expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Error with request header, signatures are not present") - end - end - context 'timestamp is not present' do - it 'throws "Error with request header, timestamp is not present"' do - request_header = "v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" - signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" - tolerance = 5 * 60 - request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" - expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Error with request header, timestamp is not present") - end - end - context 'Request header is empty' do - it 'throws "Error with request header, Request header is empty"' do - request_header = "" - signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" - tolerance = 5 * 60 - request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" - expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Error with request header, Request header is empty") - end + describe '#check_request_header' do + context 'signatures are not present' do + it 'throws "Error with request header, signatures are not present"' do + request_header = "t=1679944186," + signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" + tolerance = 5 * 60 + request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" + expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Error with request header, signatures are not present") end end + context 'timestamp is not present' do + it 'throws "Error with request header, timestamp is not present"' do + request_header = "v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" + signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" + tolerance = 5 * 60 + request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" + expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Error with request header, timestamp is not present") + end + end + context 'Request header is empty' do + it 'throws "Error with request header, Request header is empty"' do + request_header = "" + signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" + tolerance = 5 * 60 + request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" + expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Error with request header, Request header is empty") + end + end + end - describe '#check_signing_secret' do - context 'Signing secret is empty' do - it 'throws "Signing secret cannot be empty or null"' do - request_header = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" - signing_secret = "" - tolerance = 5 * 60 - request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" - expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Signing secret cannot be empty or null") - end - end - context 'Signing secret is nil' do - it 'throws "Signing secret cannot be empty or null"' do - request_header = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" - signing_secret = nil - tolerance = 5 * 60 - request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" - expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Signing secret cannot be empty or null") - end + describe '#check_signing_secret' do + context 'Signing secret is empty' do + it 'throws "Signing secret cannot be empty or null"' do + request_header = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" + signing_secret = "" + tolerance = 5 * 60 + request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" + expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Signing secret cannot be empty or null") end end + context 'Signing secret is nil' do + it 'throws "Signing secret cannot be empty or null"' do + request_header = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" + signing_secret = nil + tolerance = 5 * 60 + request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" + expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Signing secret cannot be empty or null") + end + end + end - describe '#check_tolerance' do - context 'Tolerance value is a negative value' do - it 'throws "Tolerance value must be a positive integer"' do - request_header = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" - signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" - tolerance = -5 - request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" - expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Tolerance value must be a positive integer") - end - end - context 'Tolerance value is 0' do - it 'throws "Tolerance value must be a positive integer"' do - request_header = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" - signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" - tolerance = 0 - request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" - expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Tolerance value must be a positive integer") - end - end - context 'Tolerance value is NaN' do - it 'throws "Tolerance value must be a positive integer"' do - request_header = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" - signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" - tolerance = Float::NAN - request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" - expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Tolerance value must be a positive integer") - end + describe '#check_tolerance' do + context 'Tolerance value is a negative value' do + it 'throws "Tolerance value must be a positive integer"' do + request_header = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" + signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" + tolerance = -5 + request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" + expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Tolerance value must be a positive integer") end end + context 'Tolerance value is 0' do + it 'throws "Tolerance value must be a positive integer"' do + request_header = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" + signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" + tolerance = 0 + request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" + expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Tolerance value must be a positive integer") + end + end + context 'Tolerance value is NaN' do + it 'throws "Tolerance value must be a positive integer"' do + request_header = "t=1679944186,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" + signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" + tolerance = Float::NAN + request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" + expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Tolerance value must be a positive integer") + end + end + end - describe '#verify_tolerance' do - context 'Request plus tolerance is not less than the current datetime' do - it 'throws "Request time exceeded tolerance threshold. Request: 1900871395, CurrentTime: currentTimeValue, tolerance, toleranceValue"' do - currentTime = DateTime.now.strftime('%s').to_i - timeCalculation = currentTime - (6 * 60) - request_header = "t=#{timeCalculation},v1=1d798c86e977ff734dec3a8b8d67fe8621dcc1df46ef4212e0bfe2e122b01bfd,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" - signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" - tolerance = (5 * 60) - request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" - expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Request time exceeded tolerance threshold. Request: #{timeCalculation}" + ", CurrentTime: " + currentTime.to_s + ", tolerance: " + tolerance.to_s) - end + describe '#verify_tolerance' do + context 'Request plus tolerance is not less than the current datetime' do + it 'throws "Request time exceeded tolerance threshold. Request: 1900871395, CurrentTime: currentTimeValue, tolerance, toleranceValue"' do + currentTime = DateTime.now.strftime('%s').to_i + timeCalculation = currentTime - (6 * 60) + request_header = "t=#{timeCalculation},v1=1d798c86e977ff734dec3a8b8d67fe8621dcc1df46ef4212e0bfe2e122b01bfd,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" + signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" + tolerance = (5 * 60) + request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" + expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Request time exceeded tolerance threshold. Request: #{timeCalculation}" + ", CurrentTime: " + currentTime.to_s + ", tolerance: " + tolerance.to_s) end end + end - describe '#verify_signature' do - context 'Signature request is unverified, signing secret does not exist in signatures, potential typo' do - it 'throws "Unverified signature request, If this request was unexpected, it may be from a bad actor. Please proceed with caution. If the request was exepected, please check any typos or issues with the signingSecret"' do - currentTime = DateTime.now.strftime('%s').to_i - request_header = "t=#{currentTime},v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" - signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7794" - tolerance = (5 * 60) - request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" - expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Unverified signature request, If this request was unexpected, it may be from a bad actor. Please proceed with caution. If the request was exepected, please check any typos or issues with the signingSecret") - end + describe '#verify_signature' do + context 'Signature request is unverified, signing secret does not exist in signatures, potential typo' do + it 'throws "Unverified signature request, If this request was unexpected, it may be from a bad actor. Please proceed with caution. If the request was exepected, please check any typos or issues with the signingSecret"' do + currentTime = DateTime.now.strftime('%s').to_i + request_header = "t=#{currentTime},v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" + signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7794" + tolerance = (5 * 60) + request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" + expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.to raise_error("Unverified signature request, If this request was unexpected, it may be from a bad actor. Please proceed with caution. If the request was exepected, please check any typos or issues with the signingSecret") end end + end - describe '#verify_request_signature' do - context 'Request is valid' do - it 'No errors are thrown' do - request_header = "t=2130000000,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=6835006e70c9b9f610e8fb3a8b36b52b3f28c12d0a2dab75091c46ca7ec11b20" - signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" - tolerance = (5 * 60) - request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" - expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.not_to raise_error - end + describe '#verify_request_signature' do + context 'Request is valid' do + it 'No errors are thrown' do + request_header = "t=2130000000,v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=6835006e70c9b9f610e8fb3a8b36b52b3f28c12d0a2dab75091c46ca7ec11b20" + signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" + tolerance = (5 * 60) + request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" + expect { Freeclimb::RequestVerifier.verify_request_signature(request_body, request_header, signing_secret, tolerance) }.not_to raise_error end end + end end \ No newline at end of file diff --git a/spec/utils/signature_information_spec.rb b/spec/utils/signature_information_spec.rb index b368e981..75181070 100644 --- a/spec/utils/signature_information_spec.rb +++ b/spec/utils/signature_information_spec.rb @@ -1,45 +1,45 @@ require 'spec_helper' $time_stamp = 1679944186 -$FIXNUM_MAX = (2**(0.size * 8 -2) -1) +$FIXNUM_MAX = (2**(0.size * 8 - 2) - 1) describe 'SignatureInformation' do - before do - @request_header = "t=#{$time_stamp},v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" + before do + @request_header = "t=#{$time_stamp},v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" + @signature_information_object = Freeclimb::SignatureInformation.new(@request_header) + end + describe '#is_request_time_valid' do + context 'request time is within tolerance threshold' do + it 'returns true' do + @time_calculation = DateTime.now.strftime('%s').to_i + @request_header = "t=#{@time_calculation},v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" + @signature_information_object = Freeclimb::SignatureInformation.new(@request_header) + tolerance = 5 * 60 + expect(@signature_information_object.is_request_time_valid(tolerance)).to be true + end + end + context 'request time is not within tolerance threshold' do + it 'returns false since it does not match condition of request time being within tolerance threshold' do + @time_calculation = DateTime.now.strftime('%s').to_i - (600 * 60) + @request_header = "t=#{@time_calculation},v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" @signature_information_object = Freeclimb::SignatureInformation.new(@request_header) + tolerance = 500 * 60 + expect(@signature_information_object.is_request_time_valid(tolerance)).to be false + end end - describe '#is_request_time_valid' do - context 'request time is within tolerance threshold' do - it 'returns true' do - @time_calculation = DateTime.now.strftime('%s').to_i - @request_header = "t=#{@time_calculation},v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" - @signature_information_object = Freeclimb::SignatureInformation.new(@request_header) - tolerance = 5 * 60 - expect(@signature_information_object.is_request_time_valid(tolerance)).to be true - end - end - context 'request time is not within tolerance threshold' do - it 'returns false since it does not match condition of request time being within tolerance threshold' do - @time_calculation = DateTime.now.strftime('%s').to_i - (600 * 60) - @request_header = "t=#{@time_calculation},v1=c3957749baf61df4b1506802579cc69a74c77a1ae21447b930e5a704f9ec4120,v1=1ba18712726898fbbe48cd862dd096a709f7ad761a5bab14bda9ac24d963a6a8" - @signature_information_object = Freeclimb::SignatureInformation.new(@request_header) - tolerance = 500 * 60 - expect(@signature_information_object.is_request_time_valid(tolerance)).to be false - end + end + describe '#is_signature_safe' do + context 'signingSecret exists in signature array' do + it 'returns true' do + request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" + signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" + expect(@signature_information_object.is_signature_safe(request_body, signing_secret)).to be true end end - describe '#is_signature_safe' do - context 'signingSecret exists in signature array' do - it 'returns true' do - request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" - signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7793" - expect(@signature_information_object.is_signature_safe(request_body, signing_secret)).to be true - end - end - context 'signingSecret does not exists in signature array' do - it 'returns false since it does not match condition of signingSecret being within signature array' do - request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" - signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7794" - expect(@signature_information_object.is_signature_safe(request_body, signing_secret)).to be false - end - end + context 'signingSecret does not exists in signature array' do + it 'returns false since it does not match condition of signingSecret being within signature array' do + request_body = "{\"accountId\":\"AC1334ffb694cd8d969f51cddf5f7c9b478546d50c\",\"callId\":\"CAccb0b00506553cda09b51c5477f672a49e0b2213\",\"callStatus\":\"ringing\",\"conferenceId\":null,\"direction\":\"inbound\",\"from\":\"+13121000109\",\"parentCallId\":null,\"queueId\":null,\"requestType\":\"inboundCall\",\"to\":\"+13121000096\"}" + signing_secret = "sigsec_ead6d3b6904196c60835d039e91b3341c77a7794" + expect(@signature_information_object.is_signature_safe(request_body, signing_secret)).to be false + end end + end end diff --git a/yarn.lock b/yarn.lock index b8d243ad..05c53766 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,15 +17,15 @@ resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== -"@jsep-plugin/assignment@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@jsep-plugin/assignment/-/assignment-1.2.1.tgz#07277bdd7862451a865d391e2142efba33f46c9b" - integrity sha512-gaHqbubTi29aZpVbBlECRpmdia+L5/lh2BwtIJTmtxdbecEyyX/ejAOg7eQDGNvGOUmPY7Z2Yxdy9ioyH/VJeA== +"@jsep-plugin/assignment@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@jsep-plugin/assignment/-/assignment-1.3.0.tgz#fcfc5417a04933f7ceee786e8ab498aa3ce2b242" + integrity sha512-VVgV+CXrhbMI3aSusQyclHkenWSAm95WaiKrMxRFam3JSUiIaQjoMIw2sEs/OX4XifnqeQUN4DYbJjlA8EfktQ== -"@jsep-plugin/regex@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@jsep-plugin/regex/-/regex-1.0.3.tgz#3aeaa2e5fa45d89de116aeafbfa41c95935b7f6d" - integrity sha512-XfZgry4DwEZvSFtS/6Y+R48D7qJYJK6R9/yJFyUFHCIUMEEHuJ4X95TDgJp5QkmzfLYvapMPzskV5HpIDrREug== +"@jsep-plugin/regex@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@jsep-plugin/regex/-/regex-1.0.4.tgz#cb2fc423220fa71c609323b9ba7f7d344a755fcc" + integrity sha512-q7qL4Mgjs1vByCaTnDFcBnV9HS7GVPJX5vyVoCgZHNSC9rjwIlmbXG5sUuorR5ndfHAIlJ8pVStxvjXHbNvtUg== "@stoplight/http-spec@^7.0.2", "@stoplight/http-spec@^7.0.3": version "7.1.0" @@ -86,7 +86,7 @@ "@types/json-schema" "^7.0.7" json-pointer "^0.6.1" -"@stoplight/json@3.20.0", "@stoplight/json@^3.18.1": +"@stoplight/json@3.20.0", "@stoplight/json@3.21.7", "@stoplight/json@^3.18.1": version "3.20.0" resolved "https://registry.yarnpkg.com/@stoplight/json/-/json-3.20.0.tgz#3acd893c6ed3394ac0a32b383038bd9710a167f9" integrity sha512-xR5nnO2HSy7hGzchUAv1/p7V94EXwHmpbm5ORim4BQm8w/u1sF2ttIYqDx8BesTLWTybRxLysyDH+QHjpQnQdw== @@ -145,12 +145,12 @@ tslib "^2.3.1" "@stoplight/prism-http-server@^5.6.0": - version "5.8.3" - resolved "https://registry.yarnpkg.com/@stoplight/prism-http-server/-/prism-http-server-5.8.3.tgz#da4185778e83d18d72d4c2f287865276823fac17" - integrity sha512-7SOBjccS+czl9F2eKxY1Y3bjFefq+1aX2PdSHC5+HcZ2oupffRKMA0gIL2/lsvgcPGBO0HJvl6WXPLnRJ3q2yw== + version "5.12.0" + resolved "https://registry.yarnpkg.com/@stoplight/prism-http-server/-/prism-http-server-5.12.0.tgz#c1fdc86bcb7d42d3420b9b84f05f9ae8977bc953" + integrity sha512-rnACUB950kvgDGXk1MsVk1v8nAZNCRaxdrTlACoJpQA0qzF8eBszYikoDsVmx2BbGsOrCC/49+nQc+HyFFpMdQ== dependencies: "@stoplight/prism-core" "^5.8.0" - "@stoplight/prism-http" "^5.8.3" + "@stoplight/prism-http" "^5.12.0" "@stoplight/types" "^14.1.0" fast-xml-parser "^4.2.0" fp-ts "^2.11.5" @@ -162,14 +162,14 @@ tslib "^2.3.1" type-is "^1.6.18" -"@stoplight/prism-http@^5.6.0", "@stoplight/prism-http@^5.8.3": - version "5.8.3" - resolved "https://registry.yarnpkg.com/@stoplight/prism-http/-/prism-http-5.8.3.tgz#a0d10faf5bb375587fde9e58523b7a47b2340a47" - integrity sha512-v58g0d4zhLbGiKkXSIE4ineYkIK8IZ/FT3im2Sg78hhp69TkF9bZc8+XdVYPLZxt1jkLDcm2SepM/InDtaK0xA== +"@stoplight/prism-http@^5.12.0", "@stoplight/prism-http@^5.6.0": + version "5.12.0" + resolved "https://registry.yarnpkg.com/@stoplight/prism-http/-/prism-http-5.12.0.tgz#b763292c5044e9213b558cbc44e5a2187cfffea4" + integrity sha512-H+B/SO4SgQ6DT3CHIDCMQFGOe48Yecj0Eu+6rXwrs5m1JFyA2nlDwz+r73QJLGQanN4Biod2s0V9pZRcs2JnPA== dependencies: "@faker-js/faker" "^6.0.0" "@stoplight/http-spec" "^7.0.3" - "@stoplight/json" "^3.18.1" + "@stoplight/json" "3.21.7" "@stoplight/json-schema-merge-allof" "0.7.8" "@stoplight/json-schema-ref-parser" "9.2.7" "@stoplight/json-schema-sampler" "0.3.0" @@ -186,11 +186,12 @@ fp-ts "^2.11.5" http-proxy-agent "^5.0.0" https-proxy-agent "^5.0.0" - json-schema-faker "0.5.3" + json-schema-faker "0.5.8" lodash "^4.17.21" node-fetch "^2.6.5" parse-multipart-data "^1.5.0" pino "^6.13.3" + seedrandom "^3.0.5" tslib "^2.3.1" type-is "^1.6.18" uri-template-lite "^22.9.0" @@ -251,11 +252,11 @@ integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/node@*": - version "20.14.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.11.tgz#09b300423343460455043ddd4d0ded6ac579b74b" - integrity sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA== + version "22.10.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.5.tgz#95af89a3fb74a2bb41ef9927f206e6472026e48b" + integrity sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ== dependencies: - undici-types "~5.26.4" + undici-types "~6.20.0" "@types/swagger-schema-official@~2.0.22": version "2.0.25" @@ -467,18 +468,18 @@ content-type@^1.0.4: integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== cross-fetch@^3.1.5: - version "3.1.8" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.8.tgz#0327eba65fd68a7d119f8fb2bf9334a1a7956f82" - integrity sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg== + version "3.2.0" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.2.0.tgz#34e9192f53bc757d6614304d9e5e6fb4edb782e3" + integrity sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q== dependencies: - node-fetch "^2.6.12" + node-fetch "^2.7.0" debug@4: - version "4.3.5" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" - integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== + version "4.4.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" + integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== dependencies: - ms "2.1.2" + ms "^2.1.3" emoji-regex@^8.0.0: version "8.0.0" @@ -493,9 +494,9 @@ error-ex@^1.3.1: is-arrayish "^0.2.1" escalade@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27" - integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== escape-string-regexp@^1.0.5: version "1.0.5" @@ -523,14 +524,14 @@ fast-safe-stringify@^2.0.8: integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== fast-uri@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.1.tgz#cddd2eecfc83a71c1be2cc2ef2061331be8a7134" - integrity sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw== + version "3.0.5" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.5.tgz#19f5f9691d0dab9b85861a7bb5d98fca961da9cd" + integrity sha512-5JnBCWpFlMo0a3ciDy/JckMzzv1U9coZrIhedq+HXxxUfDTAiS0LA8OKVao4G9BxmCVck/jtA5r3KAtRWEyD8Q== fast-xml-parser@^4.2.0, fast-xml-parser@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.5.0.tgz#2882b7d01a6825dfdf909638f2de0256351def37" - integrity sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg== + version "4.5.1" + resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.5.1.tgz#a7e665ff79b7919100a5202f23984b6150f9b31e" + integrity sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w== dependencies: strnum "^1.0.5" @@ -586,9 +587,9 @@ format-util@^1.0.3: integrity sha512-varLbTj0e0yVyRpqQhuWV+8hlePAgaoFRhNFj50BNjEIrw1/DphHSObtqwskVCPWNgzwPoQrZAbfa/SBiicNeg== fp-ts@^2.11.5: - version "2.16.8" - resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-2.16.8.tgz#dfa1ea1c967ac6794c43ce877aeb8ed76f5e0df7" - integrity sha512-nmDtNqmMZkOxu0M5hkrS9YA15/KPkYkILb6Axg9XBAoUoYEtzg+LFmVWqZrl9FNttsW0qIUpx9RCA9INbv+Bxw== + version "2.16.9" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-2.16.9.tgz#99628fc5e0bb3b432c4a16d8f4455247380bae8a" + integrity sha512-+I2+FnVB+tVaxcYyQkHUq7ZdKScaBlX53A41mxQtpIccsfyv8PzdzP7fzp2AY832T4aoK6UZ5WRX/ebGd8uZuQ== fsevents@~2.3.2: version "2.3.3" @@ -662,9 +663,9 @@ inherits@^2.0.3: integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== io-ts@^2.2.16: - version "2.2.21" - resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-2.2.21.tgz#4ef754176f7082a1099d04c7d5c4ea53267c530a" - integrity sha512-zz2Z69v9ZIC3mMLYWIeoUcwWD6f+O7yP92FMVVaXEOSZH1jnVBmET/urd/uoarD1WGBY4rCj8TAyMPzsGNzMFQ== + version "2.2.22" + resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-2.2.22.tgz#5ab0d3636fe8494a275f0266461ab019da4b8d0b" + integrity sha512-FHCCztTkHoV9mdBsHpocLpdTAfh956ZQcIkWQxxS0U5HT53vtrcuYdQneEJKH6xILaLNzXVl2Cvwtoy8XNN0AA== is-arrayish@^0.2.1: version "0.2.1" @@ -716,10 +717,10 @@ js-yaml@^3.12.1: argparse "^1.0.7" esprima "^4.0.0" -jsep@^1.3.9: - version "1.3.9" - resolved "https://registry.yarnpkg.com/jsep/-/jsep-1.3.9.tgz#8ce42df80ee9c1b39e52d0dd062a465342f35440" - integrity sha512-i1rBX5N7VPl0eYb6+mHNp52sEuaS2Wi8CDYx1X5sn9naevL78+265XJqy1qENEk7mRKwS06NHpUqiBwR7qeodw== +jsep@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/jsep/-/jsep-1.4.0.tgz#19feccbfa51d8a79f72480b4b8e40ce2e17152f0" + integrity sha512-B7qPcEVE3NVkmSJbaYxvv4cHkVW7DQsZz13pUMrfS8z8Q/BuShN+gcTXrUlPiGqM2/t/EEaI030bpxMqY8gMlw== json-parse-better-errors@^1.0.1: version "1.0.2" @@ -755,6 +756,14 @@ json-schema-faker@0.5.3: json-schema-ref-parser "^6.1.0" jsonpath-plus "^7.2.0" +json-schema-faker@0.5.8: + version "0.5.8" + resolved "https://registry.yarnpkg.com/json-schema-faker/-/json-schema-faker-0.5.8.tgz#13e8b53fef4d86de5c5d164763c80427da892b0c" + integrity sha512-sqzPEbEDlpiH8U1tfmJHScXHy52onvMxITPsHyhe/jhS83g8TX6ruvRqt/ot1bXUPRsh7Ps1sWqJiBxIXmW5Xw== + dependencies: + json-schema-ref-parser "^6.1.0" + jsonpath-plus "^10.1.0" + json-schema-ref-parser@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/json-schema-ref-parser/-/json-schema-ref-parser-6.1.0.tgz#30af34aeab5bee0431da805dac0eb21b574bf63d" @@ -774,14 +783,14 @@ jsonc-parser@~2.2.1: resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.2.1.tgz#db73cd59d78cce28723199466b2a03d1be1df2bc" integrity sha512-o6/yDBYccGvTz1+QFevz6l6OBZ2+fMVu2JZ9CIhzsYRX4mjaK5IyX9eldUdCmga16zlgQxyrj5pt9kzuj2C02w== -jsonpath-plus@^10.0.0, jsonpath-plus@^7.2.0: - version "10.0.1" - resolved "https://registry.yarnpkg.com/jsonpath-plus/-/jsonpath-plus-10.0.1.tgz#a61f4dc6c7489955af0872b0956cc42fbbacb5ab" - integrity sha512-30DeH2QD4nL1IpDLPIFz09G5XyLvh+oNMUI2Zxf4tbrlsVHs0e3VPnwpOnSTFb4yM0dfQK2WGKLsSaAS8V62rw== +jsonpath-plus@^10.0.0, jsonpath-plus@^10.1.0, jsonpath-plus@^7.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/jsonpath-plus/-/jsonpath-plus-10.2.0.tgz#84d680544d9868579cc7c8f59bbe153a5aad54c4" + integrity sha512-T9V+8iNYKFL2n2rF+w02LBOT2JjDnTjioaNFrxRy0Bv1y/hNsqR/EBK7Ojy2ythRHwmz2cRIls+9JitQGZC/sw== dependencies: - "@jsep-plugin/assignment" "^1.2.1" - "@jsep-plugin/regex" "^1.0.3" - jsep "^1.3.9" + "@jsep-plugin/assignment" "^1.3.0" + "@jsep-plugin/regex" "^1.0.4" + jsep "^1.4.0" liquid-json@0.3.1: version "0.3.1" @@ -816,13 +825,6 @@ lodash@4.17.21, lodash@^4.17.21, lodash@^4.17.4: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -871,10 +873,10 @@ mkdirp@0.5.x: dependencies: minimist "^1.2.6" -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +ms@^2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== negotiator@0.6.3: version "0.6.3" @@ -886,7 +888,7 @@ node-abort-controller@^3.0.1: resolved "https://registry.yarnpkg.com/node-abort-controller/-/node-abort-controller-3.1.1.tgz#a94377e964a9a37ac3976d848cb5c765833b8548" integrity sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ== -node-fetch@^2.6.1, node-fetch@^2.6.12, node-fetch@^2.6.5: +node-fetch@^2.6.1, node-fetch@^2.6.5, node-fetch@^2.7.0: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== @@ -993,9 +995,9 @@ pkg-conf@^2.1.0: load-json-file "^4.0.0" postman-collection@^4.1.3: - version "4.4.0" - resolved "https://registry.yarnpkg.com/postman-collection/-/postman-collection-4.4.0.tgz#6acb6e3796fcd9f6ac5a94e6894185e42387d7da" - integrity sha512-2BGDFcUwlK08CqZFUlIC8kwRJueVzPjZnnokWPtJCd9f2J06HBQpGL7t2P1Ud1NEsK9NHq9wdipUhWLOPj5s/Q== + version "4.5.0" + resolved "https://registry.yarnpkg.com/postman-collection/-/postman-collection-4.5.0.tgz#cc485d67f2177d6f4c5c5f4bc75c257efd23f221" + integrity sha512-152JSW9pdbaoJihwjc7Q8lc3nPg/PC9lPTHdMk7SHnHhu/GBJB7b2yb9zG7Qua578+3PxkQ/HYBuXpDSvsf7GQ== dependencies: "@faker-js/faker" "5.5.3" file-type "3.9.0" @@ -1006,7 +1008,7 @@ postman-collection@^4.1.3: mime-format "2.0.1" mime-types "2.1.35" postman-url-encoder "3.0.5" - semver "7.5.4" + semver "7.6.3" uuid "8.3.2" postman-url-encoder@3.0.5: @@ -1077,12 +1079,15 @@ safe-stable-stringify@^1.1: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -semver@7.5.4: - version "7.5.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" - integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== - dependencies: - lru-cache "^6.0.0" +seedrandom@^3.0.5: + version "3.0.5" + resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-3.0.5.tgz#54edc85c95222525b0c7a6f6b3543d8e0b3aa0a7" + integrity sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg== + +semver@7.6.3: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== signale@^1.4.0: version "1.4.0" @@ -1173,9 +1178,9 @@ tr46@~0.0.3: integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== tslib@^2.2.0, tslib@^2.3.1, tslib@^2.6.2: - version "2.6.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" - integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== + version "2.8.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== type-is@^1.6.18: version "1.6.18" @@ -1185,10 +1190,10 @@ type-is@^1.6.18: media-typer "0.3.0" mime-types "~2.1.24" -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== +undici-types@~6.20.0: + version "6.20.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" + integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== uri-template-lite@^22.9.0: version "22.9.0" @@ -1282,11 +1287,6 @@ y18n@^5.0.5: resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - yaml@^1.10.2: version "1.10.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"