diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index ac9b0c8..eb26bc1 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -15,6 +15,8 @@ docs/AnsweredBy.md docs/ApplicationList.md docs/ApplicationRequest.md docs/ApplicationResult.md +docs/AudioStream.md +docs/AudioStreamWebhook.md docs/AvailableNumber.md docs/AvailableNumberList.md docs/BargeInReason.md @@ -26,6 +28,7 @@ docs/CallDirection.md docs/CallEndedReason.md docs/CallList.md docs/CallResult.md +docs/CallResultAllOfSubresourceUris.md docs/CallStatus.md docs/CallStatusWebhook.md docs/Capabilities.md @@ -178,6 +181,8 @@ lib/freeclimb/models/answered_by.rb lib/freeclimb/models/application_list.rb lib/freeclimb/models/application_request.rb lib/freeclimb/models/application_result.rb +lib/freeclimb/models/audio_stream.rb +lib/freeclimb/models/audio_stream_webhook.rb lib/freeclimb/models/available_number.rb lib/freeclimb/models/available_number_list.rb lib/freeclimb/models/barge_in_reason.rb @@ -189,6 +194,7 @@ lib/freeclimb/models/call_direction.rb lib/freeclimb/models/call_ended_reason.rb lib/freeclimb/models/call_list.rb lib/freeclimb/models/call_result.rb +lib/freeclimb/models/call_result_all_of_subresource_uris.rb lib/freeclimb/models/call_status.rb lib/freeclimb/models/call_status_webhook.rb lib/freeclimb/models/capabilities.rb @@ -336,6 +342,8 @@ 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/audio_stream_spec.rb +spec/models/audio_stream_webhook_spec.rb spec/models/available_number_list_spec.rb spec/models/available_number_spec.rb spec/models/barge_in_reason_spec.rb @@ -346,6 +354,7 @@ 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_all_of_subresource_uris_spec.rb spec/models/call_result_spec.rb spec/models/call_status_spec.rb spec/models/call_status_webhook_spec.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index bed72b9..c3ba047 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] + + +## [5.5.0] - 2026-04-06 + +### Added + +- New parameters for fetching recordings (start time and end time) +- Audio Streaming feature + ## [5.4.0] - 2025-10-24 diff --git a/Gemfile.lock b/Gemfile.lock index fda972d..21817e9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - freeclimb (5.4.0) + freeclimb (5.5.0) typhoeus (~> 1.0, >= 1.0.1) GEM diff --git a/README.md b/README.md index 0192164..571fa1c 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: 5.4.0 +- Package version: 5.5.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', '~> 5.4.0' + gem 'freeclimb', '~> 5.5.0' and run from your terminal @@ -44,9 +44,9 @@ gem build freeclimb.gemspec Then either install the gem locally: ```shell -gem install ./freeclimb-5.4.0.gem +gem install ./freeclimb-5.5.0.gem ``` -(for development, run `gem install --dev ./freeclimb-5.4.0.gem` to install the development dependencies) +(for development, run `gem install --dev ./freeclimb-5.5.0.gem` to install the development dependencies) ## Getting Started @@ -182,6 +182,8 @@ Class | Method | HTTP request | Description - [Freeclimb::ApplicationList](docs/ApplicationList.md) - [Freeclimb::ApplicationRequest](docs/ApplicationRequest.md) - [Freeclimb::ApplicationResult](docs/ApplicationResult.md) + - [Freeclimb::AudioStream](docs/AudioStream.md) + - [Freeclimb::AudioStreamWebhook](docs/AudioStreamWebhook.md) - [Freeclimb::AvailableNumber](docs/AvailableNumber.md) - [Freeclimb::AvailableNumberList](docs/AvailableNumberList.md) - [Freeclimb::BargeInReason](docs/BargeInReason.md) @@ -193,6 +195,7 @@ Class | Method | HTTP request | Description - [Freeclimb::CallEndedReason](docs/CallEndedReason.md) - [Freeclimb::CallList](docs/CallList.md) - [Freeclimb::CallResult](docs/CallResult.md) + - [Freeclimb::CallResultAllOfSubresourceUris](docs/CallResultAllOfSubresourceUris.md) - [Freeclimb::CallStatus](docs/CallStatus.md) - [Freeclimb::CallStatusWebhook](docs/CallStatusWebhook.md) - [Freeclimb::Capabilities](docs/Capabilities.md) diff --git a/docs/AudioStream.md b/docs/AudioStream.md new file mode 100644 index 0000000..b2403f5 --- /dev/null +++ b/docs/AudioStream.md @@ -0,0 +1,26 @@ +# Freeclimb::AudioStream + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **location** | **String** | The gRPC server location that will receive the grpc stream as a uri and must be port 80 or 443. | | +| **action_url** | **String** | A request is made to this URL when the gRPC session is concluded. The PerCL script returned in response to the actionUrl will be executed on the call. | [optional] | +| **content_type** | **String** | The type and sample rate of the audio being received over the channel must match the environmental sample rate. | [optional] | +| **meta_data** | **Array<String>** | An arbitrary array of strings passed through FC to the GRPC server can be used to pass state or other information about the call. | [optional] | +| **privacy_mode** | **Boolean** | Enables audio redaction with full call recording while gRPC session is running and blocks logging of any DTMFs received by FreeClimb. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::AudioStream.new( + location: null, + action_url: null, + content_type: null, + meta_data: null, + privacy_mode: null +) +``` + diff --git a/docs/AudioStreamWebhook.md b/docs/AudioStreamWebhook.md new file mode 100644 index 0000000..0376904 --- /dev/null +++ b/docs/AudioStreamWebhook.md @@ -0,0 +1,34 @@ +# Freeclimb::AudioStreamWebhook + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_type** | **String** | Context or reason why this request is being made. Will be audioStream - gRPC session for this Call has ended and its actionUrl is being invoked. | [optional] | +| **call_id** | **String** | Unique ID for this Call, generated by FreeClimb. This is the call leg which ended its gRPC session. | [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::AudioStreamWebhook.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/AvailableNumber.md b/docs/AvailableNumber.md index 2869b0f..4a41c50 100644 --- a/docs/AvailableNumber.md +++ b/docs/AvailableNumber.md @@ -7,6 +7,7 @@ | **capabilities** | [**Capabilities**](Capabilities.md) | | [optional] | | **campaign_id** | **String** | The campaign ID generated by the campaign registry | [optional] | | **phone_number** | **String** | The phone number, in E.164 format (+ country code and phone number: +18003608245). | [optional] | +| **_alias** | **String** | A nicely-formatted version of the phone number. | [optional] | | **region** | **String** | The state or province of this phone number. | [optional] | | **country** | **String** | The country of this phone number. | [optional] | @@ -19,6 +20,7 @@ instance = Freeclimb::AvailableNumber.new( capabilities: null, campaign_id: null, phone_number: null, + _alias: null, region: null, country: null ) diff --git a/docs/CallResult.md b/docs/CallResult.md index 03c4a47..b135f87 100644 --- a/docs/CallResult.md +++ b/docs/CallResult.md @@ -8,6 +8,8 @@ | **date_created** | **String** | The date that this resource was created (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). | [optional] | | **date_updated** | **String** | The date that this resource was last updated (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). | [optional] | | **revision** | **Integer** | Revision count for the resource. This count is set to 1 on creation and is incremented every time it is updated. | [optional] | +| **date_created_iso** | **Time** | The date that this resource was created in ISO 8601 format (e.g., 2022-01-01T00:00:00.000Z). | [optional] | +| **date_updated_iso** | **Time** | The date that this resource was last updated in ISO 8601 format (e.g., 2022-01-01T00:00:00.000Z). | [optional] | | **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] | @@ -16,13 +18,19 @@ | **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] | | **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] | +| **start_time_iso** | **Time** | Start time of the Call in ISO 8601 format (e.g., 2022-01-01T00:00:00.000Z). 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] | +| **connect_time_iso** | **Time** | Time the Call was answered in ISO 8601 format (e.g., 2022-01-01T00:00:00.000Z). 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] | +| **end_time_iso** | **Time** | End time of the Call in ISO 8601 format (e.g., 2022-01-01T00:00:00.000Z). 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] | +| **audio_stream_duration** | **Integer** | Length of time that the Call used the audio stream in seconds. This value is empty or zero when the Call did not use the audio stream. | [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] | +| **caller_name** | **String** | The caller ID name (CNAM) for this Call. Empty if unavailable. | [optional] | +| **web_rtc** | **Boolean** | Indicates whether this Call was initiated via WebRTC. | [optional] | +| **subresource_uris** | [**CallResultAllOfSubresourceUris**](CallResultAllOfSubresourceUris.md) | | [optional] | | **application_id** | **String** | ApplicationId associated with the Call. | [optional] | ## Example @@ -35,6 +43,8 @@ instance = Freeclimb::CallResult.new( date_created: null, date_updated: null, revision: null, + date_created_iso: null, + date_updated_iso: null, call_id: null, parent_call_id: null, account_id: null, @@ -43,12 +53,18 @@ instance = Freeclimb::CallResult.new( phone_number_id: null, status: null, start_time: null, + start_time_iso: null, connect_time: null, + connect_time_iso: null, end_time: null, + end_time_iso: null, duration: null, connect_duration: null, + audio_stream_duration: null, direction: null, answered_by: null, + caller_name: null, + web_rtc: null, subresource_uris: null, application_id: null ) diff --git a/docs/CallResultAllOfSubresourceUris.md b/docs/CallResultAllOfSubresourceUris.md new file mode 100644 index 0000000..845643b --- /dev/null +++ b/docs/CallResultAllOfSubresourceUris.md @@ -0,0 +1,20 @@ +# Freeclimb::CallResultAllOfSubresourceUris + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **logs** | **String** | The URI for the logs associated with this Call. | [optional] | +| **recordings** | **String** | The URI for the recordings associated with this Call. | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::CallResultAllOfSubresourceUris.new( + logs: null, + recordings: null +) +``` + diff --git a/docs/ConferenceResult.md b/docs/ConferenceResult.md index a7b560d..07574c8 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] | +| **play_beep** | [**PlayBeep**](PlayBeep.md) | Setting that controls when a beep is played. One of: always, never, entryOnly, exitOnly. Defaults to always. | [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/DefaultApi.md b/docs/DefaultApi.md index 87f9184..1eaa9c8 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -3272,7 +3272,9 @@ api_instance = Freeclimb::DefaultApi.new call_id = 'call_id_example' # String | String that uniquely identifies this call resource. opts = { - date_created: 'date_created_example' # String | Only show recordings created on the specified date, in the form *YYYY-MM-DD*. + date_created: 'date_created_example', # String | Only show recordings created on the specified date, in the form *YYYY-MM-DD*. + start_time: 'start_time_example', # String | Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. + end_time: 'end_time_example' # String | Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. } begin @@ -3309,6 +3311,8 @@ end | ---- | ---- | ----------- | ----- | | **call_id** | **String** | String that uniquely identifies this call resource. | | | **date_created** | **String** | Only show recordings created on the specified date, in the form *YYYY-MM-DD*. | [optional] | +| **start_time** | **String** | Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. | [optional] | +| **end_time** | **String** | Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. | [optional] | ### Return type @@ -3344,6 +3348,7 @@ end api_instance = Freeclimb::DefaultApi.new opts = { + used_audio_stream: true, # Boolean | If usedAudioStream is set to true then all calls that have a audioStreamDuration > 0 will be returned active: true, # Boolean | If active is set to true then all calls of the nature queued, ringing, inProgress are returned in the query. to: 'to_example', # String | Only show Calls to this phone number. from: 'from_example', # String | Only show Calls from this phone number. @@ -3353,7 +3358,8 @@ opts = { parent_call_id: 'parent_call_id_example', # String | Only show Calls spawned by the call with this ID. application_id: ['inner_example'], # Array | Only show calls belonging to the given applicationId. This parameter can be repeated to return calls from multiple Applications. risk_score_min: 56, # Integer | The minimum riskScore that should be included in the list. - risk_score_max: 56 # Integer | The maximum riskScore that should be included in the list. + risk_score_max: 56, # Integer | The maximum riskScore that should be included in the list. + web_rtc: true # Boolean | Only show Calls that were originated via WebRTC. } begin @@ -3388,6 +3394,7 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | +| **used_audio_stream** | **Boolean** | If usedAudioStream is set to true then all calls that have a audioStreamDuration > 0 will be returned | [optional][default to false] | | **active** | **Boolean** | If active is set to true then all calls of the nature queued, ringing, inProgress are returned in the query. | [optional][default to false] | | **to** | **String** | Only show Calls to this phone number. | [optional] | | **from** | **String** | Only show Calls from this phone number. | [optional] | @@ -3398,6 +3405,7 @@ end | **application_id** | [**Array<String>**](String.md) | Only show calls belonging to the given applicationId. This parameter can be repeated to return calls from multiple Applications. | [optional] | | **risk_score_min** | **Integer** | The minimum riskScore that should be included in the list. | [optional] | | **risk_score_max** | **Integer** | The maximum riskScore that should be included in the list. | [optional] | +| **web_rtc** | **Boolean** | Only show Calls that were originated via WebRTC. | [optional][default to false] | ### Return type @@ -3436,7 +3444,9 @@ conference_id = 'conference_id_example' # String | Show only Recordings made dur opts = { call_id: 'call_id_example', # String | Show only Recordings made during the Call with this ID. - date_created: 'date_created_example' # String | Only show Recordings created on this date, formatted as *YYYY-MM-DD*. + date_created: 'date_created_example', # String | Only show Recordings created on this date, formatted as *YYYY-MM-DD*. + start_time: 'start_time_example', # String | Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. + end_time: 'end_time_example' # String | Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. } begin @@ -3474,6 +3484,8 @@ end | **conference_id** | **String** | Show only Recordings made during the conference with this ID. | | | **call_id** | **String** | Show only Recordings made during the Call with this ID. | [optional] | | **date_created** | **String** | Only show Recordings created on this date, formatted as *YYYY-MM-DD*. | [optional] | +| **start_time** | **String** | Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. | [optional] | +| **end_time** | **String** | Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. | [optional] | ### Return type @@ -3906,7 +3918,9 @@ api_instance = Freeclimb::DefaultApi.new opts = { call_id: 'call_id_example', # String | Show only Recordings made during the Call with this ID. conference_id: 'conference_id_example', # String | Show only Recordings made during the conference with this ID. - date_created: 'date_created_example' # String | Only show Recordings created on this date, formatted as *YYYY-MM-DD*. + date_created: 'date_created_example', # String | Only show Recordings created on this date, formatted as *YYYY-MM-DD*. + start_time: 'start_time_example', # String | Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. + end_time: 'end_time_example' # String | Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. } begin @@ -3944,6 +3958,8 @@ end | **call_id** | **String** | Show only Recordings made during the Call with this ID. | [optional] | | **conference_id** | **String** | Show only Recordings made during the conference with this ID. | [optional] | | **date_created** | **String** | Only show Recordings created on this date, formatted as *YYYY-MM-DD*. | [optional] | +| **start_time** | **String** | Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. | [optional] | +| **end_time** | **String** | Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. | [optional] | ### Return type diff --git a/docs/QueueResult.md b/docs/QueueResult.md index b234ddf..6144316 100644 --- a/docs/QueueResult.md +++ b/docs/QueueResult.md @@ -14,6 +14,7 @@ | **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] | +| **average_wait_time** | **Integer** | The average wait time (in seconds) of all Calls in the Queue. | [optional] | | **subresource_uris** | **Object** | List of subresources for this Queue (which includes Queue members). | [optional] | ## Example @@ -32,6 +33,7 @@ instance = Freeclimb::QueueResult.new( max_size: null, current_size: null, average_queue_removal_time: null, + average_wait_time: null, subresource_uris: null ) ``` diff --git a/docs/RequestType.md b/docs/RequestType.md index 46b576b..9a26ce0 100644 --- a/docs/RequestType.md +++ b/docs/RequestType.md @@ -17,6 +17,7 @@ | **DEQUEUE** | **RequestType** | | Represented in Ruby as "dequeue" | | **QUEUE_WAIT** | **RequestType** | | Represented in Ruby as "queueWait" | | **ADD_TO_QUEUE_NOTIFICATION** | **RequestType** | | Represented in Ruby as "addToQueueNotification" | +| **AUDIO_STREAM** | **RequestType** | | Represented in Ruby as "audioStream" | | **REMOVE_FROM_QUEUE_NOTIFICATION** | **RequestType** | | Represented in Ruby as "removeFromQueueNotification" | | **CALL_STATUS** | **RequestType** | | Represented in Ruby as "callStatus" | | **CREATE_CONFERENCE** | **RequestType** | | Represented in Ruby as "createConference" | diff --git a/lib/freeclimb.rb b/lib/freeclimb.rb index 6324734..cdca204 100644 --- a/lib/freeclimb.rb +++ b/lib/freeclimb.rb @@ -33,6 +33,7 @@ require "freeclimb/models/call_ended_reason" require "freeclimb/models/call_list" require "freeclimb/models/call_result" +require "freeclimb/models/call_result_all_of_subresource_uris" require "freeclimb/models/call_status" require "freeclimb/models/capabilities" require "freeclimb/models/completion_request" @@ -125,6 +126,8 @@ 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/audio_stream" +require "freeclimb/models/audio_stream_webhook" require "freeclimb/models/call_control_webhook" require "freeclimb/models/call_status_webhook" require "freeclimb/models/conference_recording_status_webhook" diff --git a/lib/freeclimb/api/default_api.rb b/lib/freeclimb/api/default_api.rb index 9f443aa..ec53feb 100644 --- a/lib/freeclimb/api/default_api.rb +++ b/lib/freeclimb/api/default_api.rb @@ -2965,6 +2965,8 @@ def list_call_logs_with_http_info(call_id, opts = {}) # @param call_id [String] String that uniquely identifies this call resource. # @param [Hash] opts the optional parameters # @option opts [String] :date_created Only show recordings created on the specified date, in the form *YYYY-MM-DD*. + # @option opts [String] :start_time Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. + # @option opts [String] :end_time Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. # @return [RecordingList] def list_call_recordings(call_id, opts = {}) data, _status_code, _headers = list_call_recordings_with_http_info(call_id, opts) @@ -2975,6 +2977,8 @@ def list_call_recordings(call_id, opts = {}) # @param call_id [String] String that uniquely identifies this call resource. # @param [Hash] opts the optional parameters # @option opts [String] :date_created Only show recordings created on the specified date, in the form *YYYY-MM-DD*. + # @option opts [String] :start_time Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. + # @option opts [String] :end_time Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. # @return [Array<(RecordingList, Integer, Hash)>] RecordingList data, response status code and response headers def list_call_recordings_with_http_info(call_id, opts = {}) if @api_client.config.debugging @@ -2995,6 +2999,8 @@ def list_call_recordings_with_http_info(call_id, opts = {}) # query parameters query_params = opts[:query_params] || {} query_params[:dateCreated] = opts[:date_created] if !opts[:date_created].nil? + query_params[:startTime] = opts[:start_time] if !opts[:start_time].nil? + query_params[:endTime] = opts[:end_time] if !opts[:end_time].nil? # header parameters header_params = opts[:header_params] || {} @@ -3032,6 +3038,7 @@ def list_call_recordings_with_http_info(call_id, opts = {}) # List Calls # @param [Hash] opts the optional parameters + # @option opts [Boolean] :used_audio_stream If usedAudioStream is set to true then all calls that have a audioStreamDuration > 0 will be returned (default to false) # @option opts [Boolean] :active If active is set to true then all calls of the nature queued, ringing, inProgress are returned in the query. (default to false) # @option opts [String] :to Only show Calls to this phone number. # @option opts [String] :from Only show Calls from this phone number. @@ -3042,6 +3049,7 @@ def list_call_recordings_with_http_info(call_id, opts = {}) # @option opts [Array] :application_id Only show calls belonging to the given applicationId. This parameter can be repeated to return calls from multiple Applications. # @option opts [Integer] :risk_score_min The minimum riskScore that should be included in the list. # @option opts [Integer] :risk_score_max The maximum riskScore that should be included in the list. + # @option opts [Boolean] :web_rtc Only show Calls that were originated via WebRTC. (default to false) # @return [CallList] def list_calls(opts = {}) data, _status_code, _headers = list_calls_with_http_info(opts) @@ -3050,6 +3058,7 @@ def list_calls(opts = {}) # List Calls # @param [Hash] opts the optional parameters + # @option opts [Boolean] :used_audio_stream If usedAudioStream is set to true then all calls that have a audioStreamDuration > 0 will be returned # @option opts [Boolean] :active If active is set to true then all calls of the nature queued, ringing, inProgress are returned in the query. # @option opts [String] :to Only show Calls to this phone number. # @option opts [String] :from Only show Calls from this phone number. @@ -3060,6 +3069,7 @@ def list_calls(opts = {}) # @option opts [Array] :application_id Only show calls belonging to the given applicationId. This parameter can be repeated to return calls from multiple Applications. # @option opts [Integer] :risk_score_min The minimum riskScore that should be included in the list. # @option opts [Integer] :risk_score_max The maximum riskScore that should be included in the list. + # @option opts [Boolean] :web_rtc Only show Calls that were originated via WebRTC. # @return [Array<(CallList, Integer, Hash)>] CallList data, response status code and response headers def list_calls_with_http_info(opts = {}) if @api_client.config.debugging @@ -3079,6 +3089,7 @@ def list_calls_with_http_info(opts = {}) # query parameters query_params = opts[:query_params] || {} + query_params[:usedAudioStream] = opts[:used_audio_stream] if !opts[:used_audio_stream].nil? query_params[:active] = opts[:active] if !opts[:active].nil? query_params[:to] = opts[:to] if !opts[:to].nil? query_params[:from] = opts[:from] if !opts[:from].nil? @@ -3089,6 +3100,7 @@ def list_calls_with_http_info(opts = {}) query_params[:applicationId] = @api_client.build_collection_param(opts[:application_id], :multi) if !opts[:application_id].nil? query_params[:riskScoreMin] = opts[:risk_score_min] if !opts[:risk_score_min].nil? query_params[:riskScoreMax] = opts[:risk_score_max] if !opts[:risk_score_max].nil? + query_params[:webRTC] = opts[:web_rtc] if !opts[:web_rtc].nil? # header parameters header_params = opts[:header_params] || {} @@ -3129,6 +3141,8 @@ def list_calls_with_http_info(opts = {}) # @param [Hash] opts the optional parameters # @option opts [String] :call_id Show only Recordings made during the Call with this ID. # @option opts [String] :date_created Only show Recordings created on this date, formatted as *YYYY-MM-DD*. + # @option opts [String] :start_time Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. + # @option opts [String] :end_time Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. # @return [RecordingList] def list_conference_recordings(conference_id, opts = {}) data, _status_code, _headers = list_conference_recordings_with_http_info(conference_id, opts) @@ -3140,6 +3154,8 @@ def list_conference_recordings(conference_id, opts = {}) # @param [Hash] opts the optional parameters # @option opts [String] :call_id Show only Recordings made during the Call with this ID. # @option opts [String] :date_created Only show Recordings created on this date, formatted as *YYYY-MM-DD*. + # @option opts [String] :start_time Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. + # @option opts [String] :end_time Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. # @return [Array<(RecordingList, Integer, Hash)>] RecordingList data, response status code and response headers def list_conference_recordings_with_http_info(conference_id, opts = {}) if @api_client.config.debugging @@ -3161,6 +3177,8 @@ def list_conference_recordings_with_http_info(conference_id, opts = {}) query_params = opts[:query_params] || {} query_params[:callId] = opts[:call_id] if !opts[:call_id].nil? query_params[:dateCreated] = opts[:date_created] if !opts[:date_created].nil? + query_params[:startTime] = opts[:start_time] if !opts[:start_time].nil? + query_params[:endTime] = opts[:end_time] if !opts[:end_time].nil? # header parameters header_params = opts[:header_params] || {} @@ -3582,6 +3600,8 @@ def list_participants_with_http_info(conference_id, opts = {}) # @option opts [String] :call_id Show only Recordings made during the Call with this ID. # @option opts [String] :conference_id Show only Recordings made during the conference with this ID. # @option opts [String] :date_created Only show Recordings created on this date, formatted as *YYYY-MM-DD*. + # @option opts [String] :start_time Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. + # @option opts [String] :end_time Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. # @return [RecordingList] def list_recordings(opts = {}) data, _status_code, _headers = list_recordings_with_http_info(opts) @@ -3593,6 +3613,8 @@ def list_recordings(opts = {}) # @option opts [String] :call_id Show only Recordings made during the Call with this ID. # @option opts [String] :conference_id Show only Recordings made during the conference with this ID. # @option opts [String] :date_created Only show Recordings created on this date, formatted as *YYYY-MM-DD*. + # @option opts [String] :start_time Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. + # @option opts [String] :end_time Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. # @return [Array<(RecordingList, Integer, Hash)>] RecordingList data, response status code and response headers def list_recordings_with_http_info(opts = {}) if @api_client.config.debugging @@ -3611,6 +3633,8 @@ def list_recordings_with_http_info(opts = {}) query_params[:callId] = opts[:call_id] if !opts[:call_id].nil? query_params[:conferenceId] = opts[:conference_id] if !opts[:conference_id].nil? query_params[:dateCreated] = opts[:date_created] if !opts[:date_created].nil? + query_params[:startTime] = opts[:start_time] if !opts[:start_time].nil? + query_params[:endTime] = opts[:end_time] if !opts[:end_time].nil? # header parameters header_params = opts[:header_params] || {} diff --git a/lib/freeclimb/models/audio_stream.rb b/lib/freeclimb/models/audio_stream.rb new file mode 100644 index 0000000..7be1293 --- /dev/null +++ b/lib/freeclimb/models/audio_stream.rb @@ -0,0 +1,277 @@ +# #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 +# + +require "date" +require "time" + +module Freeclimb + # The `AudioStream` command transfers control of the call to a gRPC session. Upon completion of the gRPC session, if the actionUrl is specified, control can be returned to percl usage or the call will simply be hung up if the actionUrl is not specified. + class AudioStream < PerclCommand + # The gRPC server location that will receive the grpc stream as a uri and must be port 80 or 443. + attr_accessor :location + + # A request is made to this URL when the gRPC session is concluded. The PerCL script returned in response to the actionUrl will be executed on the call. + attr_accessor :action_url + + # The type and sample rate of the audio being received over the channel must match the environmental sample rate. + attr_accessor :content_type + + # An arbitrary array of strings passed through FC to the GRPC server can be used to pass state or other information about the call. + attr_accessor :meta_data + + # Enables audio redaction with full call recording while gRPC session is running and blocks logging of any DTMFs received by FreeClimb. + attr_accessor :privacy_mode + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + location: :location, + action_url: :actionUrl, + content_type: :contentType, + meta_data: :metaData, + 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 + { + location: :String, + action_url: :String, + content_type: :String, + meta_data: :"Array", + privacy_mode: :Boolean + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :PerclCommand + ] + 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::AudioStream` 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::AudioStream`. 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 + + if attributes.key?(:location) + self.location = attributes[:location] + end + + if attributes.key?(:action_url) + self.action_url = attributes[:action_url] + end + + if attributes.key?(:content_type) + self.content_type = attributes[:content_type] + end + + if attributes.key?(:meta_data) + if (value = attributes[:meta_data]).is_a?(Array) + self.meta_data = value + end + end + + if attributes.key?(:privacy_mode) + self.privacy_mode = attributes[:privacy_mode] + end + self.command = "AudioStream" + 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 + if @location.nil? + invalid_properties.push('invalid value for "location", location 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 @location.nil? + false + else + list_invalid_properties.length == 0 + end + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(other) + return true if equal?(other) + self.class == other.class && + location == other.location && + action_url == other.action_url && + content_type == other.content_type && + meta_data == other.meta_data && + privacy_mode == other.privacy_mode && super + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(other) + self == other + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [location, action_url, content_type, meta_data, 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 + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + 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) + send(:"#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + 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 = 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/audio_stream_webhook.rb b/lib/freeclimb/models/audio_stream_webhook.rb new file mode 100644 index 0000000..169a549 --- /dev/null +++ b/lib/freeclimb/models/audio_stream_webhook.rb @@ -0,0 +1,341 @@ +# #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 +# + +require "date" +require "time" + +module Freeclimb + # A gRPC session has ended for this Call its actionUrl is being invoked. A PerCL response is expected — unless the URL is invoked due to the participant hanging up. + class AudioStreamWebhook < Webhook + def self.deserialize(payload) + return nil if payload.nil? || payload.empty? + data = JSON.parse("[#{payload}]")[0] + inverted_attributes = attribute_map.invert + hash = acceptable_attributes.uniq.map { |k| [inverted_attributes[k], data[k.to_s]] }.to_h + AudioStreamWebhook.new(hash) + end + # Context or reason why this request is being made. Will be audioStream - gRPC session for this Call has ended and its actionUrl is being invoked. + attr_accessor :request_type + + # Unique ID for this Call, generated by FreeClimb. This is the call leg which ended its gRPC session. + 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 + + 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 + } + 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 + } + 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::AudioStreamWebhook` 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::AudioStreamWebhook`. 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 + + 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 + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + super + 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 ==(other) + return true if equal?(other) + self.class == other.class && + request_type == other.request_type && + call_id == other.call_id && + account_id == other.account_id && + from == other.from && + to == other.to && + call_status == other.call_status && + direction == other.direction && + conference_id == other.conference_id && + queue_id == other.queue_id && super + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(other) + self == other + 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].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 + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + 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) + send(:"#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + 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 = 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 165674b..f92534d 100644 --- a/lib/freeclimb/models/available_number.rb +++ b/lib/freeclimb/models/available_number.rb @@ -21,6 +21,9 @@ class AvailableNumber # The phone number, in E.164 format (+ country code and phone number: +18003608245). attr_accessor :phone_number + # A nicely-formatted version of the phone number. + attr_accessor :_alias + # The state or province of this phone number. attr_accessor :region @@ -33,6 +36,7 @@ def self.attribute_map capabilities: :capabilities, campaign_id: :campaignId, phone_number: :phoneNumber, + _alias: :alias, region: :region, country: :country } @@ -49,6 +53,7 @@ def self.openapi_types capabilities: :Capabilities, campaign_id: :String, phone_number: :String, + _alias: :String, region: :String, country: :String } @@ -59,6 +64,7 @@ def self.openapi_nullable Set.new([ :campaign_id, :phone_number, + :_alias, :region, :country ]) @@ -91,6 +97,10 @@ def initialize(attributes = {}) self.phone_number = attributes[:phone_number] end + if attributes.key?(:_alias) + self._alias = attributes[:_alias] + end + if attributes.key?(:region) self.region = attributes[:region] end @@ -124,6 +134,7 @@ def ==(other) capabilities == other.capabilities && campaign_id == other.campaign_id && phone_number == other.phone_number && + _alias == other._alias && region == other.region && country == other.country end @@ -137,7 +148,7 @@ def eql?(other) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [capabilities, campaign_id, phone_number, region, country].hash + [capabilities, campaign_id, phone_number, _alias, region, country].hash end # Builds the object from hash diff --git a/lib/freeclimb/models/call_result.rb b/lib/freeclimb/models/call_result.rb index be21684..379e9e2 100644 --- a/lib/freeclimb/models/call_result.rb +++ b/lib/freeclimb/models/call_result.rb @@ -25,6 +25,12 @@ class CallResult # Revision count for the resource. This count is set to 1 on creation and is incremented every time it is updated. attr_accessor :revision + # The date that this resource was created in ISO 8601 format (e.g., 2022-01-01T00:00:00.000Z). + attr_accessor :date_created_iso + + # The date that this resource was last updated in ISO 8601 format (e.g., 2022-01-01T00:00:00.000Z). + attr_accessor :date_updated_iso + # String that uniquely identifies this Call resource. attr_accessor :call_id @@ -48,23 +54,40 @@ class CallResult # 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 + # Start time of the Call in ISO 8601 format (e.g., 2022-01-01T00:00:00.000Z). Empty if the Call has not yet been dialed. + attr_accessor :start_time_iso + # 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 + # Time the Call was answered in ISO 8601 format (e.g., 2022-01-01T00:00:00.000Z). Empty if the Call has not yet been dialed. + attr_accessor :connect_time_iso + # 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 + # End time of the Call in ISO 8601 format (e.g., 2022-01-01T00:00:00.000Z). Empty if the Call did not complete successfully. + attr_accessor :end_time_iso + # 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 # 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 + # Length of time that the Call used the audio stream in seconds. This value is empty or zero when the Call did not use the audio stream. + attr_accessor :audio_stream_duration + attr_accessor :direction attr_accessor :answered_by - # The list of subresources for this Call. These include things like logs and recordings associated with the Call. + # The caller ID name (CNAM) for this Call. Empty if unavailable. + attr_accessor :caller_name + + # Indicates whether this Call was initiated via WebRTC. + attr_accessor :web_rtc + attr_accessor :subresource_uris # ApplicationId associated with the Call. @@ -99,6 +122,8 @@ def self.attribute_map date_created: :dateCreated, date_updated: :dateUpdated, revision: :revision, + date_created_iso: :dateCreatedISO, + date_updated_iso: :dateUpdatedISO, call_id: :callId, parent_call_id: :parentCallId, account_id: :accountId, @@ -107,12 +132,18 @@ def self.attribute_map phone_number_id: :phoneNumberId, status: :status, start_time: :startTime, + start_time_iso: :startTimeISO, connect_time: :connectTime, + connect_time_iso: :connectTimeISO, end_time: :endTime, + end_time_iso: :endTimeISO, duration: :duration, connect_duration: :connectDuration, + audio_stream_duration: :audioStreamDuration, direction: :direction, answered_by: :answeredBy, + caller_name: :callerName, + web_rtc: :webRTC, subresource_uris: :subresourceUris, application_id: :applicationId } @@ -130,6 +161,8 @@ def self.openapi_types date_created: :String, date_updated: :String, revision: :Integer, + date_created_iso: :Time, + date_updated_iso: :Time, call_id: :String, parent_call_id: :String, account_id: :String, @@ -138,13 +171,19 @@ def self.openapi_types phone_number_id: :String, status: :CallStatus, start_time: :String, + start_time_iso: :Time, connect_time: :String, + connect_time_iso: :Time, end_time: :String, + end_time_iso: :Time, duration: :Integer, connect_duration: :Integer, + audio_stream_duration: :Integer, direction: :CallDirection, answered_by: :AnsweredBy, - subresource_uris: :Object, + caller_name: :String, + web_rtc: :Boolean, + subresource_uris: :CallResultAllOfSubresourceUris, application_id: :String } end @@ -152,6 +191,8 @@ def self.openapi_types # List of attributes with nullable: true def self.openapi_nullable Set.new([ + :date_created_iso, + :date_updated_iso, :call_id, :parent_call_id, :account_id, @@ -160,12 +201,18 @@ def self.openapi_nullable :phone_number_id, :status, :start_time, + :start_time_iso, :connect_time, + :connect_time_iso, :end_time, + :end_time_iso, :duration, :connect_duration, + :audio_stream_duration, :direction, :answered_by, + :caller_name, + :web_rtc, :subresource_uris, :application_id ]) @@ -209,6 +256,14 @@ def initialize(attributes = {}) self.revision = attributes[:revision] end + if attributes.key?(:date_created_iso) + self.date_created_iso = attributes[:date_created_iso] + end + + if attributes.key?(:date_updated_iso) + self.date_updated_iso = attributes[:date_updated_iso] + end + if attributes.key?(:call_id) self.call_id = attributes[:call_id] end @@ -241,14 +296,26 @@ def initialize(attributes = {}) self.start_time = attributes[:start_time] end + if attributes.key?(:start_time_iso) + self.start_time_iso = attributes[:start_time_iso] + end + if attributes.key?(:connect_time) self.connect_time = attributes[:connect_time] end + if attributes.key?(:connect_time_iso) + self.connect_time_iso = attributes[:connect_time_iso] + end + if attributes.key?(:end_time) self.end_time = attributes[:end_time] end + if attributes.key?(:end_time_iso) + self.end_time_iso = attributes[:end_time_iso] + end + if attributes.key?(:duration) self.duration = attributes[:duration] end @@ -257,6 +324,10 @@ def initialize(attributes = {}) self.connect_duration = attributes[:connect_duration] end + if attributes.key?(:audio_stream_duration) + self.audio_stream_duration = attributes[:audio_stream_duration] + end + if attributes.key?(:direction) self.direction = attributes[:direction] end @@ -265,6 +336,14 @@ def initialize(attributes = {}) self.answered_by = attributes[:answered_by] end + if attributes.key?(:caller_name) + self.caller_name = attributes[:caller_name] + end + + if attributes.key?(:web_rtc) + self.web_rtc = attributes[:web_rtc] + end + if attributes.key?(:subresource_uris) self.subresource_uris = attributes[:subresource_uris] end @@ -299,6 +378,8 @@ def ==(other) date_created == other.date_created && date_updated == other.date_updated && revision == other.revision && + date_created_iso == other.date_created_iso && + date_updated_iso == other.date_updated_iso && call_id == other.call_id && parent_call_id == other.parent_call_id && account_id == other.account_id && @@ -307,12 +388,18 @@ def ==(other) phone_number_id == other.phone_number_id && status == other.status && start_time == other.start_time && + start_time_iso == other.start_time_iso && connect_time == other.connect_time && + connect_time_iso == other.connect_time_iso && end_time == other.end_time && + end_time_iso == other.end_time_iso && duration == other.duration && connect_duration == other.connect_duration && + audio_stream_duration == other.audio_stream_duration && direction == other.direction && answered_by == other.answered_by && + caller_name == other.caller_name && + web_rtc == other.web_rtc && subresource_uris == other.subresource_uris && application_id == other.application_id end @@ -326,7 +413,7 @@ def eql?(other) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [uri, date_created, date_updated, revision, call_id, parent_call_id, account_id, from, to, phone_number_id, status, start_time, connect_time, end_time, duration, connect_duration, direction, answered_by, subresource_uris, application_id].hash + [uri, date_created, date_updated, revision, date_created_iso, date_updated_iso, call_id, parent_call_id, account_id, from, to, phone_number_id, status, start_time, start_time_iso, connect_time, connect_time_iso, end_time, end_time_iso, duration, connect_duration, audio_stream_duration, direction, answered_by, caller_name, web_rtc, subresource_uris, application_id].hash end # Builds the object from hash diff --git a/lib/freeclimb/models/call_result_all_of_subresource_uris.rb b/lib/freeclimb/models/call_result_all_of_subresource_uris.rb new file mode 100644 index 0000000..37ac2f3 --- /dev/null +++ b/lib/freeclimb/models/call_result_all_of_subresource_uris.rb @@ -0,0 +1,228 @@ +# #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 +# + +require "date" +require "time" + +module Freeclimb + # The list of subresources for this Call. These include things like logs and recordings associated with the Call. + class CallResultAllOfSubresourceUris + # The URI for the logs associated with this Call. + attr_accessor :logs + + # The URI for the recordings associated with this Call. + attr_accessor :recordings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + logs: :logs, + 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 + { + logs: :String, + recordings: :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::CallResultAllOfSubresourceUris` 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::CallResultAllOfSubresourceUris`. 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) + self.logs = attributes[:logs] + end + + if attributes.key?(:recordings) + self.recordings = attributes[:recordings] + 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 + [] + 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 ==(other) + return true if equal?(other) + self.class == other.class && + logs == other.logs && + recordings == other.recordings + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(other) + self == other + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [logs, 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) + 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) + send(:"#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + 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 = 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 4c93b98..4b70550 100644 --- a/lib/freeclimb/models/conference_result.rb +++ b/lib/freeclimb/models/conference_result.rb @@ -34,6 +34,7 @@ class ConferenceResult # A description for this Conference. attr_accessor :_alias + # Setting that controls when a beep is played. One of: always, never, entryOnly, exitOnly. Defaults to always. attr_accessor :play_beep # Flag indicating whether recording is enabled for this Conference. diff --git a/lib/freeclimb/models/incoming_number_result.rb b/lib/freeclimb/models/incoming_number_result.rb index dad86ca..7087181 100644 --- a/lib/freeclimb/models/incoming_number_result.rb +++ b/lib/freeclimb/models/incoming_number_result.rb @@ -114,7 +114,8 @@ def self.openapi_nullable :_alias, :region, :country, - :offnet + :offnet, + :tfn ]) end diff --git a/lib/freeclimb/models/message_result.rb b/lib/freeclimb/models/message_result.rb index 344f1c3..cbea6aa 100644 --- a/lib/freeclimb/models/message_result.rb +++ b/lib/freeclimb/models/message_result.rb @@ -160,6 +160,7 @@ def self.openapi_nullable :campaign_id, :segment_count, :media_urls, + :tfn, :phone_number_id, :application_id ]) diff --git a/lib/freeclimb/models/queue_result.rb b/lib/freeclimb/models/queue_result.rb index 1e64ed1..77d6182 100644 --- a/lib/freeclimb/models/queue_result.rb +++ b/lib/freeclimb/models/queue_result.rb @@ -43,6 +43,9 @@ class QueueResult # The average amount of time (in seconds) for a call to be removed from the queue. attr_accessor :average_queue_removal_time + # The average wait time (in seconds) of all Calls in the Queue. + attr_accessor :average_wait_time + # List of subresources for this Queue (which includes Queue members). attr_accessor :subresource_uris @@ -59,6 +62,7 @@ def self.attribute_map max_size: :maxSize, current_size: :currentSize, average_queue_removal_time: :averageQueueRemovalTime, + average_wait_time: :averageWaitTime, subresource_uris: :subresourceUris } end @@ -81,6 +85,7 @@ def self.openapi_types max_size: :Integer, current_size: :Integer, average_queue_removal_time: :Integer, + average_wait_time: :Integer, subresource_uris: :Object } end @@ -94,6 +99,7 @@ def self.openapi_nullable :max_size, :current_size, :average_queue_removal_time, + :average_wait_time, :subresource_uris ]) end @@ -160,6 +166,10 @@ def initialize(attributes = {}) self.average_queue_removal_time = attributes[:average_queue_removal_time] end + if attributes.key?(:average_wait_time) + self.average_wait_time = attributes[:average_wait_time] + end + if attributes.key?(:subresource_uris) self.subresource_uris = attributes[:subresource_uris] end @@ -196,6 +206,7 @@ def ==(other) max_size == other.max_size && current_size == other.current_size && average_queue_removal_time == other.average_queue_removal_time && + average_wait_time == other.average_wait_time && subresource_uris == other.subresource_uris end @@ -208,7 +219,7 @@ def eql?(other) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [uri, date_created, date_updated, revision, account_id, queue_id, _alias, max_size, current_size, average_queue_removal_time, subresource_uris].hash + [uri, date_created, date_updated, revision, account_id, queue_id, _alias, max_size, current_size, average_queue_removal_time, average_wait_time, subresource_uris].hash end # Builds the object from hash diff --git a/lib/freeclimb/models/request_type.rb b/lib/freeclimb/models/request_type.rb index fb58f73..ff5c691 100644 --- a/lib/freeclimb/models/request_type.rb +++ b/lib/freeclimb/models/request_type.rb @@ -26,6 +26,7 @@ class RequestType DEQUEUE = "dequeue".freeze QUEUE_WAIT = "queueWait".freeze ADD_TO_QUEUE_NOTIFICATION = "addToQueueNotification".freeze + AUDIO_STREAM = "audioStream".freeze REMOVE_FROM_QUEUE_NOTIFICATION = "removeFromQueueNotification".freeze CALL_STATUS = "callStatus".freeze CREATE_CONFERENCE = "createConference".freeze diff --git a/lib/freeclimb/version.rb b/lib/freeclimb/version.rb index d5af1a1..e4ee1d9 100644 --- a/lib/freeclimb/version.rb +++ b/lib/freeclimb/version.rb @@ -9,5 +9,5 @@ # module Freeclimb - VERSION = "5.4.0" + VERSION = "5.5.0" end diff --git a/openapi.json b/openapi.json index d89e37c..3f2a4fc 100644 --- a/openapi.json +++ b/openapi.json @@ -320,6 +320,7 @@ "dequeue", "queueWait", "addToQueueNotification", + "audioStream", "removeFromQueueNotification", "callStatus", "createConference", @@ -460,6 +461,7 @@ "propertyName": "command", "mapping": { "AddToConference": "#/components/schemas/AddToConference", + "AudioStream": "#/components/schemas/AudioStream", "CreateConference": "#/components/schemas/CreateConference", "Dequeue": "#/components/schemas/Dequeue", "Enqueue": "#/components/schemas/Enqueue", @@ -501,6 +503,7 @@ "mapping": { "addToConferenceNotification": "#/components/schemas/AddToConferenceNotificationWebhook", "addToQueueNotification": "#/components/schemas/AddToQueueNotificationWebhook", + "audioStream": "#/components/schemas/AudioStreamWebhook", "callControl": "#/components/schemas/CallControlWebhook", "callStatus": "#/components/schemas/CallStatusWebhook", "conferenceRecordingStatus": "#/components/schemas/ConferenceRecordingStatusWebhook", @@ -643,6 +646,55 @@ } ] }, + "AudioStreamWebhook": { + "description": "A gRPC session has ended for this Call its actionUrl 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 audioStream - gRPC session for this Call has ended and its actionUrl is being invoked." + }, + "callId": { + "type": "string", + "description": "Unique ID for this Call, generated by FreeClimb. This is the call leg which ended its gRPC session." + }, + "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 + } + } + } + ] + }, "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": [ @@ -1964,6 +2016,45 @@ } ] }, + "AudioStream": { + "description": "The `AudioStream` command transfers control of the call to a gRPC session. Upon completion of the gRPC session, if the actionUrl is specified, control can be returned to percl usage or the call will simply be hung up if the actionUrl is not specified.", + "allOf": [ + { + "$ref": "#/components/schemas/PerclCommand" + }, + { + "type": "object", + "required": ["location"], + "properties": { + "location": { + "description": "The gRPC server location that will receive the grpc stream as a uri and must be port 80 or 443.", + "type": "string", + "format": "uri" + }, + "actionUrl": { + "description": "A request is made to this URL when the gRPC session is concluded. The PerCL script returned in response to the actionUrl will be executed on the call.", + "type": "string", + "format": "uri" + }, + "contentType": { + "description": "The type and sample rate of the audio being received over the channel must match the environmental sample rate.", + "type": "string" + }, + "metaData": { + "description": "An arbitrary array of strings passed through FC to the GRPC server can be used to pass state or other information about the call.", + "type": "array", + "items": { + "type": "string" + } + }, + "privacyMode": { + "description": "Enables audio redaction with full call recording while gRPC session is running and blocks logging of any DTMFs received by FreeClimb.", + "type": "boolean" + } + } + } + ] + }, "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.", "allOf": [ @@ -2935,6 +3026,11 @@ "description": "The phone number, in E.164 format (+ country code and phone number: +18003608245).", "nullable": true }, + "alias": { + "type": "string", + "description": "A nicely-formatted version of the phone number.", + "nullable": true + }, "voiceEnabled": { "type": "boolean", "description": "Typically set to true for all numbers.", @@ -3047,7 +3143,7 @@ "nullable": true }, "tfn": { - "$ref": "#/components/schemas/TFN", + "allOf": [{ "$ref": "#/components/schemas/TFN" }], "nullable": true } } @@ -3109,6 +3205,21 @@ } } }, + "CallResultAllOfSubresourceUris": { + "type": "object", + "description": "The list of subresources for this Call. These include things like logs and recordings associated with the Call.", + "nullable": true, + "properties": { + "logs": { + "type": "string", + "description": "The URI for the logs associated with this Call." + }, + "recordings": { + "type": "string", + "description": "The URI for the recordings associated with this Call." + } + } + }, "CallResult": { "allOf": [ { @@ -3117,6 +3228,18 @@ { "type": "object", "properties": { + "dateCreatedISO": { + "type": "string", + "format": "date-time", + "description": "The date that this resource was created in ISO 8601 format (e.g., 2022-01-01T00:00:00.000Z).", + "nullable": true + }, + "dateUpdatedISO": { + "type": "string", + "format": "date-time", + "description": "The date that this resource was last updated in ISO 8601 format (e.g., 2022-01-01T00:00:00.000Z).", + "nullable": true + }, "callId": { "type": "string", "description": "String that uniquely identifies this Call resource.", @@ -3155,16 +3278,34 @@ "description": "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.", "nullable": true }, + "startTimeISO": { + "type": "string", + "format": "date-time", + "description": "Start time of the Call in ISO 8601 format (e.g., 2022-01-01T00:00:00.000Z). Empty if the Call has not yet been dialed.", + "nullable": true + }, "connectTime": { "type": "string", "description": "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.", "nullable": true }, + "connectTimeISO": { + "type": "string", + "format": "date-time", + "description": "Time the Call was answered in ISO 8601 format (e.g., 2022-01-01T00:00:00.000Z). Empty if the Call has not yet been dialed.", + "nullable": true + }, "endTime": { "type": "string", "description": "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.", "nullable": true }, + "endTimeISO": { + "type": "string", + "format": "date-time", + "description": "End time of the Call in ISO 8601 format (e.g., 2022-01-01T00:00:00.000Z). Empty if the Call did not complete successfully.", + "nullable": true + }, "duration": { "type": "integer", "description": "Total length of the Call in seconds. Measures time between startTime and endTime. This value is empty for busy, failed, unanswered or ongoing Calls.", @@ -3175,17 +3316,30 @@ "description": "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.", "nullable": true }, + "audioStreamDuration": { + "type": "integer", + "description": "Length of time that the Call used the audio stream in seconds. This value is empty or zero when the Call did not use the audio stream.", + "nullable": true + }, "direction": { "$ref": "#/components/schemas/CallDirection" }, "answeredBy": { "$ref": "#/components/schemas/AnsweredBy" }, - "subresourceUris": { - "type": "object", - "description": "The list of subresources for this Call. These include things like logs and recordings associated with the Call.", + "callerName": { + "type": "string", + "description": "The caller ID name (CNAM) for this Call. Empty if unavailable.", "nullable": true }, + "webRTC": { + "type": "boolean", + "description": "Indicates whether this Call was initiated via WebRTC.", + "nullable": true + }, + "subresourceUris": { + "$ref": "#/components/schemas/CallResultAllOfSubresourceUris" + }, "applicationId": { "type": "string", "description": "ApplicationId associated with the Call.", @@ -3410,7 +3564,7 @@ "nullable": true }, "playBeep": { - "$ref": "#/components/schemas/PlayBeep", + "allOf": [{ "$ref": "#/components/schemas/PlayBeep" }], "description": "Setting that controls when a beep is played. One of: always, never, entryOnly, exitOnly. Defaults to always." }, "record": { @@ -3622,7 +3776,7 @@ "nullable": true }, "tfn": { - "$ref": "#/components/schemas/TFN", + "allOf": [{ "$ref": "#/components/schemas/TFN" }], "nullable": true }, "phoneNumberId": { @@ -3853,6 +4007,11 @@ "description": "The average amount of time (in seconds) for a call to be removed from the queue.", "nullable": true }, + "averageWaitTime": { + "type": "integer", + "description": "The average wait time (in seconds) of all Calls in the Queue.", + "nullable": true + }, "subresourceUris": { "type": "object", "description": "List of subresources for this Queue (which includes Queue members).", @@ -6003,6 +6162,16 @@ "summary": "List Calls", "operationId": "list-calls", "parameters": [ + { + "name": "usedAudioStream", + "in": "query", + "description": "If usedAudioStream is set to true then all calls that have a audioStreamDuration > 0 will be returned ", + "required": false, + "schema": { + "type": "boolean", + "default": false + } + }, { "name": "active", "in": "query", @@ -6102,6 +6271,16 @@ "schema": { "type": "integer" } + }, + { + "name": "webRTC", + "in": "query", + "description": "Only show Calls that were originated via WebRTC.", + "required": false, + "schema": { + "type": "boolean", + "default": false + } } ], "deprecated": false, @@ -6145,6 +6324,24 @@ "schema": { "type": "string" } + }, + { + "name": "startTime", + "in": "query", + "description": "Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "endTime", + "in": "query", + "description": "Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss.", + "required": false, + "schema": { + "type": "string" + } } ], "deprecated": false, @@ -6619,6 +6816,24 @@ "schema": { "type": "string" } + }, + { + "name": "startTime", + "in": "query", + "description": "Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "endTime", + "in": "query", + "description": "Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss.", + "required": false, + "schema": { + "type": "string" + } } ], "responses": { @@ -6766,7 +6981,7 @@ }, "deprecated": false, "responses": { - "200": { + "201": { "description": "Successfuly created queue", "content": { "application/json": { @@ -7057,6 +7272,24 @@ }, { "$ref": "#/components/parameters/AccountId" + }, + { + "name": "startTime", + "in": "query", + "description": "Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "endTime", + "in": "query", + "description": "Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss.", + "required": false, + "schema": { + "type": "string" + } } ], "responses": { diff --git a/package.json b/package.json index fbb4854..036ebec 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,7 @@ { "dependencies": { - "@stoplight/prism-cli": "5.6.0", - "fast-xml-parser": "^4.5.0", + "@stoplight/prism-cli": "5.14.2", + "fast-xml-parser": "^5.3.8", "jsonpath-plus": "^10.3.0" - }, - "resolutions": { - "@stoplight/json": "3.20.0", - "jsonpath-plus": "^10.0.0", - "fast-xml-parser": "^4.5.0" } } diff --git a/spec/api/default_api_spec.rb b/spec/api/default_api_spec.rb index 7e5e4ef..55e2e0e 100644 --- a/spec/api/default_api_spec.rb +++ b/spec/api/default_api_spec.rb @@ -279,6 +279,22 @@ @replace_blob_request_replace_blob_test_value = Freeclimb::ReplaceBlobRequest.new({blob: {}}) @blob_id_replace_blob_test_value = "BL0123456789abcdefABCDEF0123456789abcdef00" + + @start_time_list_call_recordings_test_value = "startTime_example" + + @end_time_list_call_recordings_test_value = "endTime_example" + + @used_audio_stream_list_calls_test_value = true + + @start_time_list_recordings_test_value = "startTime_example" + + @end_time_list_recordings_test_value = "endTime_example" + + @start_time_list_conference_recordings_test_value = "startTime_example" + + @end_time_list_conference_recordings_test_value = "endTime_example" + + @web_rtc_list_calls_test_value = true end after do @@ -1193,16 +1209,20 @@ # @param call_id String that uniquely identifies this call resource. # @param [Hash] opts the optional parameters # @option opts [String] :date_created Only show recordings created on the specified date, in the form *YYYY-MM-DD*. + # @option opts [String] :start_time Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. + # @option opts [String] :end_time Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. # @return [RecordingList] describe "list_call_recordings test" do it "should work" do call_id = @call_id_list_call_recordings_test_value date_created = @date_created_list_call_recordings_test_value + start_time = @start_time_list_call_recordings_test_value + end_time = @end_time_list_call_recordings_test_value result = @api_instance.list_call_recordings( call_id, { - date_created: date_created + date_created: date_created, start_time: start_time, end_time: end_time } ) @@ -1215,6 +1235,7 @@ # unit tests for list_calls # List Calls # @param [Hash] opts the optional parameters + # @option opts [Boolean] :used_audio_stream If usedAudioStream is set to true then all calls that have a audioStreamDuration > 0 will be returned # @option opts [Boolean] :active If active is set to true then all calls of the nature queued, ringing, inProgress are returned in the query. # @option opts [String] :to Only show Calls to this phone number. # @option opts [String] :from Only show Calls from this phone number. @@ -1225,9 +1246,11 @@ # @option opts [Array] :application_id Only show calls belonging to the given applicationId. This parameter can be repeated to return calls from multiple Applications. # @option opts [Integer] :risk_score_min The minimum riskScore that should be included in the list. # @option opts [Integer] :risk_score_max The maximum riskScore that should be included in the list. + # @option opts [Boolean] :web_rtc Only show Calls that were originated via WebRTC. # @return [CallList] describe "list_calls test" do it "should work" do + used_audio_stream = @used_audio_stream_list_calls_test_value active = @active_list_calls_test_value to = @to_list_calls_test_value from = @from_list_calls_test_value @@ -1238,10 +1261,11 @@ application_id = @application_id_list_calls_test_value risk_score_min = @risk_score_min_list_calls_test_value risk_score_max = @risk_score_max_list_calls_test_value + web_rtc = @web_rtc_list_calls_test_value 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, risk_score_min: risk_score_min, risk_score_max: risk_score_max + used_audio_stream: used_audio_stream, 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, risk_score_min: risk_score_min, risk_score_max: risk_score_max, web_rtc: web_rtc } ) @@ -1257,17 +1281,21 @@ # @param [Hash] opts the optional parameters # @option opts [String] :call_id Show only Recordings made during the Call with this ID. # @option opts [String] :date_created Only show Recordings created on this date, formatted as *YYYY-MM-DD*. + # @option opts [String] :start_time Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. + # @option opts [String] :end_time Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. # @return [RecordingList] describe "list_conference_recordings test" do it "should work" do conference_id = @conference_id_list_conference_recordings_test_value call_id = @call_id_list_conference_recordings_test_value date_created = @date_created_list_conference_recordings_test_value + start_time = @start_time_list_conference_recordings_test_value + end_time = @end_time_list_conference_recordings_test_value result = @api_instance.list_conference_recordings( conference_id, { - call_id: call_id, date_created: date_created + call_id: call_id, date_created: date_created, start_time: start_time, end_time: end_time } ) @@ -1428,16 +1456,20 @@ # @option opts [String] :call_id Show only Recordings made during the Call with this ID. # @option opts [String] :conference_id Show only Recordings made during the conference with this ID. # @option opts [String] :date_created Only show Recordings created on this date, formatted as *YYYY-MM-DD*. + # @option opts [String] :start_time Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. + # @option opts [String] :end_time Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. # @return [RecordingList] describe "list_recordings test" do it "should work" do call_id = @call_id_list_recordings_test_value conference_id = @conference_id_list_recordings_test_value date_created = @date_created_list_recordings_test_value + start_time = @start_time_list_recordings_test_value + end_time = @end_time_list_recordings_test_value 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, start_time: start_time, end_time: end_time } ) @@ -2024,16 +2056,20 @@ # @param call_id String that uniquely identifies this call resource. # @param [Hash] opts the optional parameters # @option opts [String] :date_created Only show recordings created on the specified date, in the form *YYYY-MM-DD*. + # @option opts [String] :start_time Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. + # @option opts [String] :end_time Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. # @return [RecordingList] describe "list_call_recordings_get_next_page test" do it "should work" do call_id = @call_id_list_call_recordings_test_value date_created = @date_created_list_call_recordings_test_value + start_time = @start_time_list_call_recordings_test_value + end_time = @end_time_list_call_recordings_test_value result = @api_instance.list_call_recordings( call_id, { - date_created: date_created + date_created: date_created, start_time: start_time, end_time: end_time } ) result.next_page_uri = "/Accounts/{accountId}/Calls/{callId}/Recordings?cursor=1".sub("{accountId}", @account_id_test_value) @@ -2046,6 +2082,7 @@ # unit tests for get_next_page list_calls # List Calls # @param [Hash] opts the optional parameters + # @option opts [Boolean] :used_audio_stream If usedAudioStream is set to true then all calls that have a audioStreamDuration > 0 will be returned # @option opts [Boolean] :active If active is set to true then all calls of the nature queued, ringing, inProgress are returned in the query. # @option opts [String] :to Only show Calls to this phone number. # @option opts [String] :from Only show Calls from this phone number. @@ -2056,9 +2093,11 @@ # @option opts [Array] :application_id Only show calls belonging to the given applicationId. This parameter can be repeated to return calls from multiple Applications. # @option opts [Integer] :risk_score_min The minimum riskScore that should be included in the list. # @option opts [Integer] :risk_score_max The maximum riskScore that should be included in the list. + # @option opts [Boolean] :web_rtc Only show Calls that were originated via WebRTC. # @return [CallList] describe "list_calls_get_next_page test" do it "should work" do + used_audio_stream = @used_audio_stream_list_calls_test_value active = @active_list_calls_test_value to = @to_list_calls_test_value from = @from_list_calls_test_value @@ -2069,10 +2108,11 @@ application_id = @application_id_list_calls_test_value risk_score_min = @risk_score_min_list_calls_test_value risk_score_max = @risk_score_max_list_calls_test_value + web_rtc = @web_rtc_list_calls_test_value 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, risk_score_min: risk_score_min, risk_score_max: risk_score_max + used_audio_stream: used_audio_stream, 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, risk_score_min: risk_score_min, risk_score_max: risk_score_max, web_rtc: web_rtc } ) result.next_page_uri = "/Accounts/{accountId}/Calls?cursor=1".sub("{accountId}", @account_id_test_value) @@ -2088,17 +2128,21 @@ # @param [Hash] opts the optional parameters # @option opts [String] :call_id Show only Recordings made during the Call with this ID. # @option opts [String] :date_created Only show Recordings created on this date, formatted as *YYYY-MM-DD*. + # @option opts [String] :start_time Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. + # @option opts [String] :end_time Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. # @return [RecordingList] describe "list_conference_recordings_get_next_page test" do it "should work" do conference_id = @conference_id_list_conference_recordings_test_value call_id = @call_id_list_conference_recordings_test_value date_created = @date_created_list_conference_recordings_test_value + start_time = @start_time_list_conference_recordings_test_value + end_time = @end_time_list_conference_recordings_test_value result = @api_instance.list_conference_recordings( conference_id, { - call_id: call_id, date_created: date_created + call_id: call_id, date_created: date_created, start_time: start_time, end_time: end_time } ) result.next_page_uri = "/Accounts/{accountId}/Conferences/{conferenceId}/Recordings?cursor=1".sub("{accountId}", @account_id_test_value) @@ -2259,16 +2303,20 @@ # @option opts [String] :call_id Show only Recordings made during the Call with this ID. # @option opts [String] :conference_id Show only Recordings made during the conference with this ID. # @option opts [String] :date_created Only show Recordings created on this date, formatted as *YYYY-MM-DD*. + # @option opts [String] :start_time Only show Recordings created at or after this time, given as YYYY-MM-DD hh:mm:ss. + # @option opts [String] :end_time Only show Recordings created at or before this time, given as YYYY-MM-DD hh:mm:ss. # @return [RecordingList] describe "list_recordings_get_next_page test" do it "should work" do call_id = @call_id_list_recordings_test_value conference_id = @conference_id_list_recordings_test_value date_created = @date_created_list_recordings_test_value + start_time = @start_time_list_recordings_test_value + end_time = @end_time_list_recordings_test_value 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, start_time: start_time, end_time: end_time } ) result.next_page_uri = "/Accounts/{accountId}/Recordings?cursor=1".sub("{accountId}", @account_id_test_value) diff --git a/spec/models/audio_stream_spec.rb b/spec/models/audio_stream_spec.rb new file mode 100644 index 0000000..6c2e499 --- /dev/null +++ b/spec/models/audio_stream_spec.rb @@ -0,0 +1,358 @@ +# #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 +# + +require "spec_helper" +require "json" +require "date" +include Freeclimb + +# Unit tests for Freeclimb::AudioStream +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::AudioStream do + let(:instance) { Freeclimb::AudioStream.new } + + describe "test an instance of AudioStream" do + it "should create an instance of AudioStream" do + expect(instance).to be_instance_of(Freeclimb::AudioStream) + end + end + + describe 'test attribute "location"' do + it "should work" do + instance.location = "TEST_STRING" + expect(instance.location).to eq("TEST_STRING") + end + end + + describe 'test attribute "action_url"' do + it "should work" do + instance.action_url = "TEST_STRING" + expect(instance.action_url).to eq("TEST_STRING") + end + end + + describe 'test attribute "content_type"' do + it "should work" do + instance.content_type = "TEST_STRING" + expect(instance.content_type).to eq("TEST_STRING") + end + end + + describe 'test attribute "meta_data"' do + it "should work" do + instance.meta_data = ["ELEMENT_1", "ELEMENT_2"] + expect(instance.meta_data).to eq(["ELEMENT_1", "ELEMENT_2"]) + 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 { + Freeclimb::AudioStream.new( + location: "TS", + + action_url: "TS", + + content_type: "TS", + + meta_data: [], + + privacy_mode: true + ) + }.not_to raise_error + end + it "fails to initialize with input argument that is not a hash in Freeclimb::AudioStream" do + expect { + Freeclimb::AudioStream.new( + location: "TS", + + action_url: "TS", + + content_type: "TS", + + meta_data: [], + + privacy_mode: true, + + invalid_attribute: true + ) + }.to raise_error(ArgumentError) + end + it "fails to initialize with invalid attribute" do + expect { + Freeclimb::AudioStream.new( + location: "TS", + + action_url: "TS", + + content_type: "TS", + + meta_data: [], + + 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::AudioStream.new( + location: "TS", + + action_url: "TS", + + content_type: "TS", + + meta_data: [], + + privacy_mode: true + ) + expect(instance.valid?).to eq(true) + end + + skip "checks if properties are invalid" do + instance = Freeclimb::AudioStream.new + + expect(instance.valid?).to eq(false) + end + end + + describe 'test method "eql?"' do + it "checks if objects are equal" do + instance_1 = Freeclimb::AudioStream.new( + location: "TS", + + action_url: "TS", + + content_type: "TS", + + meta_data: [], + + privacy_mode: true + ) + instance_2 = Freeclimb::AudioStream.new( + location: "TS", + + action_url: "TS", + + content_type: "TS", + + meta_data: [], + + privacy_mode: true + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it "checks if objects are not equal" do + instance_1 = Freeclimb::AudioStream.new( + location: "TS", + + action_url: "TS", + + content_type: "TS", + + meta_data: [], + + privacy_mode: true + ) + instance_2 = Freeclimb::AudioStream.new( + location: "ST", + + action_url: "ST", + + content_type: "ST", + + meta_data: nil, + + 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::AudioStream.new( + location: "TS", + + action_url: "TS", + + content_type: "TS", + + meta_data: [], + + 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::AudioStream.new( + location: "TS", + + action_url: "TS", + + content_type: "TS", + + meta_data: [], + + privacy_mode: true + ) + instance_2 = Freeclimb::AudioStream.new( + location: "TS", + + action_url: "TS", + + content_type: "TS", + + meta_data: [], + + 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::AudioStream.new( + location: "TS", + + action_url: "TS", + + content_type: "TS", + + meta_data: [], + + privacy_mode: true + ) + it "deserializes the data of location" do + expect(instance._deserialize("String", instance.location)).to be_a_kind_of(String) + end + + it "deserializes the data of action_url" do + expect(instance._deserialize("String", instance.action_url)).to be_a_kind_of(String) + end + + it "deserializes the data of content_type" do + expect(instance._deserialize("String", instance.content_type)).to be_a_kind_of(String) + end + + it "deserializes the data of meta_data" do + expect(instance._deserialize("Array", instance.meta_data)).to be_a_kind_of(Array) + 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::AudioStream.new( + location: "TS", + + action_url: "TS", + + content_type: "TS", + + meta_data: [], + + 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::AudioStream.new( + location: "TS", + + action_url: "TS", + + content_type: "TS", + + meta_data: [], + + privacy_mode: true + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it "creates equal hash for two equal objects" do + instance_1 = Freeclimb::AudioStream.new( + location: "TS", + + action_url: "TS", + + content_type: "TS", + + meta_data: [], + + privacy_mode: true + ) + instance_2 = Freeclimb::AudioStream.new( + location: "TS", + + action_url: "TS", + + content_type: "TS", + + meta_data: [], + + privacy_mode: true + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::AudioStream.new( + location: "TS", + + action_url: "TS", + + content_type: "TS", + + meta_data: [], + + privacy_mode: true + ) + it "returns location in the form of hash" do + expect(instance._to_hash(instance.location)).to eq(instance.location) + end + it "returns action_url in the form of hash" do + expect(instance._to_hash(instance.action_url)).to eq(instance.action_url) + end + it "returns content_type in the form of hash" do + expect(instance._to_hash(instance.content_type)).to eq(instance.content_type) + end + it "returns meta_data in the form of hash" do + expect(instance._to_hash(instance.meta_data)).to eq(instance.meta_data) + 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/audio_stream_webhook_spec.rb b/spec/models/audio_stream_webhook_spec.rb new file mode 100644 index 0000000..714c9f0 --- /dev/null +++ b/spec/models/audio_stream_webhook_spec.rb @@ -0,0 +1,583 @@ +# #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 +# + +require "spec_helper" +require "json" +require "date" +include Freeclimb + +# Unit tests for Freeclimb::AudioStreamWebhook +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::AudioStreamWebhook do + let(:instance) { Freeclimb::AudioStreamWebhook.new } + + describe "test an instance of AudioStreamWebhook" do + it "should create an instance of AudioStreamWebhook" do + expect(instance).to be_instance_of(Freeclimb::AudioStreamWebhook) + end + end + describe ".deserialize" do + it "deserializes a json payload into instance of AudioStreamWebhook" do + payload = '{ "requestType": "audioStream" }' + expect(Freeclimb::AudioStreamWebhook.deserialize(payload)).to be_instance_of(Freeclimb::AudioStreamWebhook) + 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 { + Freeclimb::AudioStreamWebhook.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::AudioStreamWebhook" do + expect { + Freeclimb::AudioStreamWebhook.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 { + Freeclimb::AudioStreamWebhook.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::AudioStreamWebhook.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::AudioStreamWebhook.new + + expect(instance.valid?).to eq(false) + end + end + + describe 'test method "eql?"' do + it "checks if objects are equal" do + instance_1 = Freeclimb::AudioStreamWebhook.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::AudioStreamWebhook.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::AudioStreamWebhook.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::AudioStreamWebhook.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::AudioStreamWebhook.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::AudioStreamWebhook.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::AudioStreamWebhook.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::AudioStreamWebhook.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::AudioStreamWebhook.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::AudioStreamWebhook.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 + instance_1 = Freeclimb::AudioStreamWebhook.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::AudioStreamWebhook.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::AudioStreamWebhook.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/available_number_spec.rb b/spec/models/available_number_spec.rb index 160c526..2668e65 100644 --- a/spec/models/available_number_spec.rb +++ b/spec/models/available_number_spec.rb @@ -46,6 +46,13 @@ end end + describe 'test attribute "_alias"' do + it "should work" do + instance._alias = "TEST_STRING" + expect(instance._alias).to eq("TEST_STRING") + end + end + describe 'test attribute "region"' do it "should work" do instance.region = "TEST_STRING" @@ -70,6 +77,8 @@ phone_number: "TS", + _alias: "TS", + region: "TS", country: "TS" @@ -85,6 +94,8 @@ phone_number: "TS", + _alias: "TS", + region: "TS", country: "TS", @@ -102,6 +113,8 @@ phone_number: "TS", + _alias: "TS", + region: "TS", country: "TS", @@ -121,6 +134,8 @@ phone_number: "TS", + _alias: "TS", + region: "TS", country: "TS" @@ -146,6 +161,8 @@ phone_number: "TS", + _alias: "TS", + region: "TS", country: "TS" @@ -157,6 +174,8 @@ phone_number: "TS", + _alias: "TS", + region: "TS", country: "TS" @@ -172,6 +191,8 @@ phone_number: "TS", + _alias: "TS", + region: "TS", country: "TS" @@ -183,6 +204,8 @@ phone_number: "ST", + _alias: "ST", + region: "ST", country: "ST" @@ -200,6 +223,8 @@ phone_number: "TS", + _alias: "TS", + region: "TS", country: "TS" @@ -217,6 +242,8 @@ phone_number: "TS", + _alias: "TS", + region: "TS", country: "TS" @@ -228,6 +255,8 @@ phone_number: "TS", + _alias: "TS", + region: "TS", country: "TS" @@ -245,6 +274,8 @@ phone_number: "TS", + _alias: "TS", + region: "TS", country: "TS" @@ -262,6 +293,10 @@ expect(instance._deserialize("String", instance.phone_number)).to be_a_kind_of(String) end + it "deserializes the data of _alias" do + expect(instance._deserialize("String", instance._alias)).to be_a_kind_of(String) + end + it "deserializes the data of region" do expect(instance._deserialize("String", instance.region)).to be_a_kind_of(String) end @@ -280,6 +315,8 @@ phone_number: "TS", + _alias: "TS", + region: "TS", country: "TS" @@ -297,6 +334,8 @@ phone_number: "TS", + _alias: "TS", + region: "TS", country: "TS" @@ -313,6 +352,8 @@ phone_number: "TS", + _alias: "TS", + region: "TS", country: "TS" @@ -324,6 +365,8 @@ phone_number: "TS", + _alias: "TS", + region: "TS", country: "TS" @@ -338,6 +381,8 @@ phone_number: "TS", + _alias: "TS", + region: "TS", country: "TS" @@ -351,6 +396,9 @@ it "returns phone_number in the form of hash" do expect(instance._to_hash(instance.phone_number)).to eq(instance.phone_number) end + it "returns _alias in the form of hash" do + expect(instance._to_hash(instance._alias)).to eq(instance._alias) + end it "returns region in the form of hash" do expect(instance._to_hash(instance.region)).to eq(instance.region) end diff --git a/spec/models/call_result_all_of_subresource_uris_spec.rb b/spec/models/call_result_all_of_subresource_uris_spec.rb new file mode 100644 index 0000000..3ee0391 --- /dev/null +++ b/spec/models/call_result_all_of_subresource_uris_spec.rb @@ -0,0 +1,214 @@ +# #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 +# + +require "spec_helper" +require "json" +require "date" +include Freeclimb + +# Unit tests for Freeclimb::CallResultAllOfSubresourceUris +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::CallResultAllOfSubresourceUris do + let(:instance) { Freeclimb::CallResultAllOfSubresourceUris.new } + + describe "test an instance of CallResultAllOfSubresourceUris" do + it "should create an instance of CallResultAllOfSubresourceUris" do + expect(instance).to be_instance_of(Freeclimb::CallResultAllOfSubresourceUris) + end + end + + describe 'test attribute "logs"' do + it "should work" do + instance.logs = "TEST_STRING" + expect(instance.logs).to eq("TEST_STRING") + end + end + + describe 'test attribute "recordings"' do + it "should work" do + instance.recordings = "TEST_STRING" + expect(instance.recordings).to eq("TEST_STRING") + end + end + + describe 'test method "initialize"' do + it "properly initializes with values" do + expect { + Freeclimb::CallResultAllOfSubresourceUris.new( + logs: "TS", + + recordings: "TS" + ) + }.not_to raise_error + end + it "fails to initialize with input argument that is not a hash in Freeclimb::CallResultAllOfSubresourceUris" do + expect { + Freeclimb::CallResultAllOfSubresourceUris.new( + logs: "TS", + + recordings: "TS", + + invalid_attribute: true + ) + }.to raise_error(ArgumentError) + end + it "fails to initialize with invalid attribute" do + expect { + Freeclimb::CallResultAllOfSubresourceUris.new( + logs: "TS", + + recordings: "TS", + + invalid_attribute: true + ) + }.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it "checks if properties are valid" do + instance = Freeclimb::CallResultAllOfSubresourceUris.new( + logs: "TS", + + recordings: "TS" + ) + expect(instance.valid?).to eq(true) + end + + skip "checks if properties are invalid" do + instance = Freeclimb::CallResultAllOfSubresourceUris.new + + expect(instance.valid?).to eq(false) + end + end + + describe 'test method "eql?"' do + it "checks if objects are equal" do + instance_1 = Freeclimb::CallResultAllOfSubresourceUris.new( + logs: "TS", + + recordings: "TS" + ) + instance_2 = Freeclimb::CallResultAllOfSubresourceUris.new( + logs: "TS", + + recordings: "TS" + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it "checks if objects are not equal" do + instance_1 = Freeclimb::CallResultAllOfSubresourceUris.new( + logs: "TS", + + recordings: "TS" + ) + instance_2 = Freeclimb::CallResultAllOfSubresourceUris.new( + logs: "ST", + + recordings: "ST" + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it "calculates hash code" do + instance = Freeclimb::CallResultAllOfSubresourceUris.new( + logs: "TS", + + recordings: "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::CallResultAllOfSubresourceUris.new( + logs: "TS", + + recordings: "TS" + ) + instance_2 = Freeclimb::CallResultAllOfSubresourceUris.new( + logs: "TS", + + recordings: "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::CallResultAllOfSubresourceUris.new( + logs: "TS", + + recordings: "TS" + ) + it "deserializes the data of logs" do + expect(instance._deserialize("String", instance.logs)).to be_a_kind_of(String) + end + + it "deserializes the data of recordings" do + expect(instance._deserialize("String", instance.recordings)).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::CallResultAllOfSubresourceUris.new( + logs: "TS", + + recordings: "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::CallResultAllOfSubresourceUris.new( + logs: "TS", + + recordings: "TS" + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it "creates equal hash for two equal objects" do + instance_1 = Freeclimb::CallResultAllOfSubresourceUris.new( + logs: "TS", + + recordings: "TS" + ) + instance_2 = Freeclimb::CallResultAllOfSubresourceUris.new( + logs: "TS", + + recordings: "TS" + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::CallResultAllOfSubresourceUris.new( + logs: "TS", + + recordings: "TS" + ) + it "returns logs in the form of hash" do + expect(instance._to_hash(instance.logs)).to eq(instance.logs) + end + it "returns recordings in the form of hash" do + expect(instance._to_hash(instance.recordings)).to eq(instance.recordings) + end + end +end diff --git a/spec/models/call_result_spec.rb b/spec/models/call_result_spec.rb index 8e234e1..2f99829 100644 --- a/spec/models/call_result_spec.rb +++ b/spec/models/call_result_spec.rb @@ -53,6 +53,20 @@ end end + describe 'test attribute "date_created_iso"' do + it "should work" do + instance.date_created_iso = "2022-07-05T15:17:05Z" + expect(instance.date_created_iso).to eq("2022-07-05T15:17:05Z") + end + end + + describe 'test attribute "date_updated_iso"' do + it "should work" do + instance.date_updated_iso = "2022-07-05T15:17:05Z" + expect(instance.date_updated_iso).to eq("2022-07-05T15:17:05Z") + end + end + describe 'test attribute "call_id"' do it "should work" do instance.call_id = "TEST_STRING" @@ -136,6 +150,13 @@ end end + describe 'test attribute "start_time_iso"' do + it "should work" do + instance.start_time_iso = "2022-07-05T15:17:05Z" + expect(instance.start_time_iso).to eq("2022-07-05T15:17:05Z") + end + end + describe 'test attribute "connect_time"' do it "should work" do instance.connect_time = "TEST_STRING" @@ -143,6 +164,13 @@ end end + describe 'test attribute "connect_time_iso"' do + it "should work" do + instance.connect_time_iso = "2022-07-05T15:17:05Z" + expect(instance.connect_time_iso).to eq("2022-07-05T15:17:05Z") + end + end + describe 'test attribute "end_time"' do it "should work" do instance.end_time = "TEST_STRING" @@ -150,6 +178,13 @@ end end + describe 'test attribute "end_time_iso"' do + it "should work" do + instance.end_time_iso = "2022-07-05T15:17:05Z" + expect(instance.end_time_iso).to eq("2022-07-05T15:17:05Z") + end + end + describe 'test attribute "duration"' do it "should work" do instance.duration = 1 @@ -164,6 +199,13 @@ end end + describe 'test attribute "audio_stream_duration"' do + it "should work" do + instance.audio_stream_duration = 1 + expect(instance.audio_stream_duration).to eq(1) + end + end + describe 'test attribute "direction"' do it "assigns value INBOUND" do instance.direction = Freeclimb::CallDirection::INBOUND @@ -189,14 +231,24 @@ expect(instance.answered_by).to eq(Freeclimb::AnsweredBy::MACHINE) end end - describe 'test attribute "subresource_uris"' do + describe 'test attribute "caller_name"' do it "should work" do - testObject = Object.new - instance.subresource_uris = testObject - expect(instance.subresource_uris).to eq(testObject) + instance.caller_name = "TEST_STRING" + expect(instance.caller_name).to eq("TEST_STRING") + end + end - instance.subresource_uris = Object.new - expect(instance.subresource_uris).to be_instance_of(Object) + describe 'test attribute "web_rtc"' do + it "should work" do + instance.web_rtc = false + expect(instance.web_rtc).to eq(false) + end + end + + describe 'test attribute "subresource_uris"' do + it "should work" do + instance.subresource_uris = CallResultAllOfSubresourceUris.new + expect(instance.subresource_uris).to be_instance_of(CallResultAllOfSubresourceUris) end end @@ -219,6 +271,10 @@ revision: 1, + date_created_iso: "2022-07-05T15:17:05Z", + + date_updated_iso: "2022-07-05T15:17:05Z", + call_id: "TS", parent_call_id: "TS", @@ -235,19 +291,31 @@ start_time: "TS", + start_time_iso: "2022-07-05T15:17:05Z", + connect_time: "TS", + connect_time_iso: "2022-07-05T15:17:05Z", + end_time: "TS", + end_time_iso: "2022-07-05T15:17:05Z", + duration: 1, connect_duration: 1, + audio_stream_duration: 1, + direction: Freeclimb::CallDirection::INBOUND, answered_by: Freeclimb::AnsweredBy::HUMAN, - subresource_uris: Object.new, + caller_name: "TS", + + web_rtc: true, + + subresource_uris: CallResultAllOfSubresourceUris.new, application_id: "TS" ) @@ -264,6 +332,10 @@ revision: 1, + date_created_iso: "2022-07-05T15:17:05Z", + + date_updated_iso: "2022-07-05T15:17:05Z", + call_id: "TS", parent_call_id: "TS", @@ -280,19 +352,31 @@ start_time: "TS", + start_time_iso: "2022-07-05T15:17:05Z", + connect_time: "TS", + connect_time_iso: "2022-07-05T15:17:05Z", + end_time: "TS", + end_time_iso: "2022-07-05T15:17:05Z", + duration: 1, connect_duration: 1, + audio_stream_duration: 1, + direction: Freeclimb::CallDirection::INBOUND, answered_by: Freeclimb::AnsweredBy::HUMAN, - subresource_uris: Object.new, + caller_name: "TS", + + web_rtc: true, + + subresource_uris: CallResultAllOfSubresourceUris.new, application_id: "TS", @@ -311,6 +395,10 @@ revision: 1, + date_created_iso: "2022-07-05T15:17:05Z", + + date_updated_iso: "2022-07-05T15:17:05Z", + call_id: "TS", parent_call_id: "TS", @@ -327,19 +415,31 @@ start_time: "TS", + start_time_iso: "2022-07-05T15:17:05Z", + connect_time: "TS", + connect_time_iso: "2022-07-05T15:17:05Z", + end_time: "TS", + end_time_iso: "2022-07-05T15:17:05Z", + duration: 1, connect_duration: 1, + audio_stream_duration: 1, + direction: Freeclimb::CallDirection::INBOUND, answered_by: Freeclimb::AnsweredBy::HUMAN, - subresource_uris: Object.new, + caller_name: "TS", + + web_rtc: true, + + subresource_uris: CallResultAllOfSubresourceUris.new, application_id: "TS", @@ -360,6 +460,10 @@ revision: 1, + date_created_iso: "2022-07-05T15:17:05Z", + + date_updated_iso: "2022-07-05T15:17:05Z", + call_id: "TS", parent_call_id: "TS", @@ -376,19 +480,31 @@ start_time: "TS", + start_time_iso: "2022-07-05T15:17:05Z", + connect_time: "TS", + connect_time_iso: "2022-07-05T15:17:05Z", + end_time: "TS", + end_time_iso: "2022-07-05T15:17:05Z", + duration: 1, connect_duration: 1, + audio_stream_duration: 1, + direction: Freeclimb::CallDirection::INBOUND, answered_by: Freeclimb::AnsweredBy::HUMAN, - subresource_uris: Object.new, + caller_name: "TS", + + web_rtc: true, + + subresource_uris: CallResultAllOfSubresourceUris.new, application_id: "TS" ) @@ -439,10 +555,16 @@ connect_duration: 1, + audio_stream_duration: 1, + direction: Freeclimb::CallDirection::INBOUND, answered_by: Freeclimb::AnsweredBy::HUMAN, + caller_name: "TS", + + web_rtc: true, + subresource_uris: obj_subresource_uris, application_id: "TS" @@ -480,10 +602,16 @@ connect_duration: 1, + audio_stream_duration: 1, + direction: Freeclimb::CallDirection::INBOUND, answered_by: Freeclimb::AnsweredBy::HUMAN, + caller_name: "TS", + + web_rtc: true, + subresource_uris: obj_subresource_uris, application_id: "TS" @@ -525,13 +653,17 @@ connect_duration: 2, + audio_stream_duration: 2, + direction: Freeclimb::CallDirection::INBOUND, answered_by: Freeclimb::AnsweredBy::HUMAN, - subresource_uris: Object.new, + caller_name: "TS", + + web_rtc: true, - subresource_uris: Object.new, + subresource_uris: CallResultAllOfSubresourceUris.new, application_id: "TS" ) @@ -568,11 +700,17 @@ connect_duration: 1, + audio_stream_duration: 1, + direction: nil, answered_by: nil, - subresource_uris: Object.new, + caller_name: "ST", + + web_rtc: false, + + subresource_uris: CallResultAllOfSubresourceUris.new, application_id: "ST" ) @@ -591,6 +729,10 @@ revision: 1, + date_created_iso: "2022-07-05T15:17:05Z", + + date_updated_iso: "2022-07-05T15:17:05Z", + call_id: "TS", parent_call_id: "TS", @@ -607,19 +749,31 @@ start_time: "TS", + start_time_iso: "2022-07-05T15:17:05Z", + connect_time: "TS", + connect_time_iso: "2022-07-05T15:17:05Z", + end_time: "TS", + end_time_iso: "2022-07-05T15:17:05Z", + duration: 1, connect_duration: 1, + audio_stream_duration: 1, + direction: Freeclimb::CallDirection::INBOUND, answered_by: Freeclimb::AnsweredBy::HUMAN, - subresource_uris: Object.new, + caller_name: "TS", + + web_rtc: true, + + subresource_uris: CallResultAllOfSubresourceUris.new, application_id: "TS" ) @@ -638,6 +792,10 @@ revision: 1, + date_created_iso: "2022-07-05T15:17:05Z", + + date_updated_iso: "2022-07-05T15:17:05Z", + call_id: "TS", parent_call_id: "TS", @@ -654,19 +812,31 @@ start_time: "TS", + start_time_iso: "2022-07-05T15:17:05Z", + connect_time: "TS", + connect_time_iso: "2022-07-05T15:17:05Z", + end_time: "TS", + end_time_iso: "2022-07-05T15:17:05Z", + duration: 1, connect_duration: 1, + audio_stream_duration: 1, + direction: Freeclimb::CallDirection::INBOUND, answered_by: Freeclimb::AnsweredBy::HUMAN, - subresource_uris: Object.new, + caller_name: "TS", + + web_rtc: true, + + subresource_uris: CallResultAllOfSubresourceUris.new, application_id: "TS" ) @@ -679,6 +849,10 @@ revision: 1, + date_created_iso: "2022-07-05T15:17:05Z", + + date_updated_iso: "2022-07-05T15:17:05Z", + call_id: "TS", parent_call_id: "TS", @@ -695,19 +869,31 @@ start_time: "TS", + start_time_iso: "2022-07-05T15:17:05Z", + connect_time: "TS", + connect_time_iso: "2022-07-05T15:17:05Z", + end_time: "TS", + end_time_iso: "2022-07-05T15:17:05Z", + duration: 1, connect_duration: 1, + audio_stream_duration: 1, + direction: Freeclimb::CallDirection::INBOUND, answered_by: Freeclimb::AnsweredBy::HUMAN, - subresource_uris: Object.new, + caller_name: "TS", + + web_rtc: true, + + subresource_uris: CallResultAllOfSubresourceUris.new, application_id: "TS" ) @@ -726,6 +912,10 @@ revision: 1, + date_created_iso: "2022-07-05T15:17:05Z", + + date_updated_iso: "2022-07-05T15:17:05Z", + call_id: "TS", parent_call_id: "TS", @@ -742,19 +932,31 @@ start_time: "TS", + start_time_iso: "2022-07-05T15:17:05Z", + connect_time: "TS", + connect_time_iso: "2022-07-05T15:17:05Z", + end_time: "TS", + end_time_iso: "2022-07-05T15:17:05Z", + duration: 1, connect_duration: 1, + audio_stream_duration: 1, + direction: Freeclimb::CallDirection::INBOUND, answered_by: Freeclimb::AnsweredBy::HUMAN, - subresource_uris: Object.new, + caller_name: "TS", + + web_rtc: true, + + subresource_uris: CallResultAllOfSubresourceUris.new, application_id: "TS" ) @@ -774,6 +976,14 @@ expect(instance._deserialize("Integer", instance.revision)).to be_a_kind_of(Integer) end + it "deserializes the data of date_created_iso" do + expect(instance._deserialize("Time", instance.date_created_iso)).to be_a_kind_of(Time) + end + + it "deserializes the data of date_updated_iso" do + expect(instance._deserialize("Time", instance.date_updated_iso)).to be_a_kind_of(Time) + end + it "deserializes the data of call_id" do expect(instance._deserialize("String", instance.call_id)).to be_a_kind_of(String) end @@ -802,14 +1012,26 @@ expect(instance._deserialize("String", instance.start_time)).to be_a_kind_of(String) end + it "deserializes the data of start_time_iso" do + expect(instance._deserialize("Time", instance.start_time_iso)).to be_a_kind_of(Time) + end + it "deserializes the data of connect_time" do expect(instance._deserialize("String", instance.connect_time)).to be_a_kind_of(String) end + it "deserializes the data of connect_time_iso" do + expect(instance._deserialize("Time", instance.connect_time_iso)).to be_a_kind_of(Time) + end + it "deserializes the data of end_time" do expect(instance._deserialize("String", instance.end_time)).to be_a_kind_of(String) end + it "deserializes the data of end_time_iso" do + expect(instance._deserialize("Time", instance.end_time_iso)).to be_a_kind_of(Time) + end + it "deserializes the data of duration" do expect(instance._deserialize("Integer", instance.duration)).to be_a_kind_of(Integer) end @@ -818,8 +1040,20 @@ expect(instance._deserialize("Integer", instance.connect_duration)).to be_a_kind_of(Integer) end + it "deserializes the data of audio_stream_duration" do + expect(instance._deserialize("Integer", instance.audio_stream_duration)).to be_a_kind_of(Integer) + end + + it "deserializes the data of caller_name" do + expect(instance._deserialize("String", instance.caller_name)).to be_a_kind_of(String) + end + + it "deserializes the data of web_rtc" do + expect(instance._deserialize("Boolean", instance.web_rtc)).to be_a_kind_of(TrueClass) + end + it "deserializes the data of subresource_uris" do - expect(instance._deserialize("Object", instance.subresource_uris)).to be_a_kind_of(Object) + expect(instance._deserialize("Object", instance.subresource_uris)).to be_a_kind_of(CallResultAllOfSubresourceUris) end it "deserializes the data of application_id" do @@ -838,6 +1072,10 @@ revision: 1, + date_created_iso: "2022-07-05T15:17:05Z", + + date_updated_iso: "2022-07-05T15:17:05Z", + call_id: "TS", parent_call_id: "TS", @@ -854,19 +1092,31 @@ start_time: "TS", + start_time_iso: "2022-07-05T15:17:05Z", + connect_time: "TS", + connect_time_iso: "2022-07-05T15:17:05Z", + end_time: "TS", + end_time_iso: "2022-07-05T15:17:05Z", + duration: 1, connect_duration: 1, + audio_stream_duration: 1, + direction: Freeclimb::CallDirection::INBOUND, answered_by: Freeclimb::AnsweredBy::HUMAN, - subresource_uris: Object.new, + caller_name: "TS", + + web_rtc: true, + + subresource_uris: CallResultAllOfSubresourceUris.new, application_id: "TS" ) @@ -885,6 +1135,10 @@ revision: 1, + date_created_iso: "2022-07-05T15:17:05Z", + + date_updated_iso: "2022-07-05T15:17:05Z", + call_id: "TS", parent_call_id: "TS", @@ -901,26 +1155,38 @@ start_time: "TS", + start_time_iso: "2022-07-05T15:17:05Z", + connect_time: "TS", + connect_time_iso: "2022-07-05T15:17:05Z", + end_time: "TS", + end_time_iso: "2022-07-05T15:17:05Z", + duration: 1, connect_duration: 1, + audio_stream_duration: 1, + direction: Freeclimb::CallDirection::INBOUND, answered_by: Freeclimb::AnsweredBy::HUMAN, - subresource_uris: Object.new, + caller_name: "TS", + + web_rtc: true, + + subresource_uris: CallResultAllOfSubresourceUris.new, application_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 + obj = CallResultAllOfSubresourceUris.new instance_1 = Freeclimb::CallResult.new( uri: "TS", @@ -931,6 +1197,10 @@ revision: 1, + date_created_iso: "2022-07-05T15:17:05Z", + + date_updated_iso: "2022-07-05T15:17:05Z", + call_id: "TS", parent_call_id: "TS", @@ -947,18 +1217,30 @@ start_time: "TS", + start_time_iso: "2022-07-05T15:17:05Z", + connect_time: "TS", + connect_time_iso: "2022-07-05T15:17:05Z", + end_time: "TS", + end_time_iso: "2022-07-05T15:17:05Z", + duration: 1, connect_duration: 1, + audio_stream_duration: 1, + direction: Freeclimb::CallDirection::INBOUND, answered_by: Freeclimb::AnsweredBy::HUMAN, + caller_name: "TS", + + web_rtc: true, + subresource_uris: obj, application_id: "TS" @@ -972,6 +1254,10 @@ revision: 1, + date_created_iso: "2022-07-05T15:17:05Z", + + date_updated_iso: "2022-07-05T15:17:05Z", + call_id: "TS", parent_call_id: "TS", @@ -988,18 +1274,30 @@ start_time: "TS", + start_time_iso: "2022-07-05T15:17:05Z", + connect_time: "TS", + connect_time_iso: "2022-07-05T15:17:05Z", + end_time: "TS", + end_time_iso: "2022-07-05T15:17:05Z", + duration: 1, connect_duration: 1, + audio_stream_duration: 1, + direction: Freeclimb::CallDirection::INBOUND, answered_by: Freeclimb::AnsweredBy::HUMAN, + caller_name: "TS", + + web_rtc: true, + subresource_uris: obj, application_id: "TS" @@ -1018,6 +1316,10 @@ revision: 1, + date_created_iso: "2022-07-05T15:17:05Z", + + date_updated_iso: "2022-07-05T15:17:05Z", + call_id: "TS", parent_call_id: "TS", @@ -1034,18 +1336,30 @@ start_time: "TS", + start_time_iso: "2022-07-05T15:17:05Z", + connect_time: "TS", + connect_time_iso: "2022-07-05T15:17:05Z", + end_time: "TS", + end_time_iso: "2022-07-05T15:17:05Z", + duration: 1, connect_duration: 1, + audio_stream_duration: 1, + direction: Freeclimb::CallDirection::INBOUND, answered_by: Freeclimb::AnsweredBy::HUMAN, + caller_name: "TS", + + web_rtc: true, + application_id: "TS" ) it "returns uri in the form of hash" do @@ -1060,6 +1374,12 @@ it "returns revision in the form of hash" do expect(instance._to_hash(instance.revision)).to eq(instance.revision) end + it "returns date_created_iso in the form of hash" do + expect(instance._to_hash(instance.date_created_iso)).to eq(instance.date_created_iso) + end + it "returns date_updated_iso in the form of hash" do + expect(instance._to_hash(instance.date_updated_iso)).to eq(instance.date_updated_iso) + end it "returns call_id in the form of hash" do expect(instance._to_hash(instance.call_id)).to eq(instance.call_id) end @@ -1084,24 +1404,42 @@ it "returns start_time in the form of hash" do expect(instance._to_hash(instance.start_time)).to eq(instance.start_time) end + it "returns start_time_iso in the form of hash" do + expect(instance._to_hash(instance.start_time_iso)).to eq(instance.start_time_iso) + end it "returns connect_time in the form of hash" do expect(instance._to_hash(instance.connect_time)).to eq(instance.connect_time) end + it "returns connect_time_iso in the form of hash" do + expect(instance._to_hash(instance.connect_time_iso)).to eq(instance.connect_time_iso) + end it "returns end_time in the form of hash" do expect(instance._to_hash(instance.end_time)).to eq(instance.end_time) end + it "returns end_time_iso in the form of hash" do + expect(instance._to_hash(instance.end_time_iso)).to eq(instance.end_time_iso) + end it "returns duration in the form of hash" do expect(instance._to_hash(instance.duration)).to eq(instance.duration) end it "returns connect_duration in the form of hash" do expect(instance._to_hash(instance.connect_duration)).to eq(instance.connect_duration) end + it "returns audio_stream_duration in the form of hash" do + expect(instance._to_hash(instance.audio_stream_duration)).to eq(instance.audio_stream_duration) + end it "returns direction in the form of hash" do expect(instance._to_hash(instance.direction)).to eq(instance.direction) end it "returns answered_by in the form of hash" do expect(instance._to_hash(instance.answered_by)).to eq(instance.answered_by) end + it "returns caller_name in the form of hash" do + expect(instance._to_hash(instance.caller_name)).to eq(instance.caller_name) + end + it "returns web_rtc in the form of hash" do + expect(instance._to_hash(instance.web_rtc)).to eq(instance.web_rtc) + end it "returns subresource_uris in the form of hash" do expect(instance._to_hash(instance.subresource_uris)).to eq(instance.subresource_uris) end diff --git a/spec/models/queue_result_spec.rb b/spec/models/queue_result_spec.rb index 380ea35..cd5510e 100644 --- a/spec/models/queue_result_spec.rb +++ b/spec/models/queue_result_spec.rb @@ -95,6 +95,13 @@ end end + describe 'test attribute "average_wait_time"' do + it "should work" do + instance.average_wait_time = 1 + expect(instance.average_wait_time).to eq(1) + end + end + describe 'test attribute "subresource_uris"' do it "should work" do testObject = Object.new @@ -130,6 +137,8 @@ average_queue_removal_time: 1, + average_wait_time: 1, + subresource_uris: Object.new ) }.not_to raise_error @@ -157,6 +166,8 @@ average_queue_removal_time: 1, + average_wait_time: 1, + subresource_uris: Object.new, invalid_attribute: true @@ -186,6 +197,8 @@ average_queue_removal_time: 1, + average_wait_time: 1, + subresource_uris: Object.new, invalid_attribute: true @@ -217,6 +230,8 @@ average_queue_removal_time: 1, + average_wait_time: 1, + subresource_uris: Object.new ) expect(instance.valid?).to eq(true) @@ -254,6 +269,8 @@ average_queue_removal_time: 1, + average_wait_time: 1, + subresource_uris: obj_subresource_uris ) instance_2 = Freeclimb::QueueResult.new( @@ -277,6 +294,8 @@ average_queue_removal_time: 1, + average_wait_time: 1, + subresource_uris: obj_subresource_uris ) expect(instance_1.eql?(instance_2)).to eq(true) @@ -304,6 +323,8 @@ average_queue_removal_time: 2, + average_wait_time: 2, + subresource_uris: Object.new, subresource_uris: Object.new @@ -329,6 +350,8 @@ average_queue_removal_time: 1, + average_wait_time: 1, + subresource_uris: Object.new ) expect(instance_1.eql?(instance_2)).to eq(false) @@ -358,6 +381,8 @@ average_queue_removal_time: 1, + average_wait_time: 1, + subresource_uris: Object.new ) expect(instance.hash).to be_a_kind_of(Integer) @@ -387,6 +412,8 @@ average_queue_removal_time: 1, + average_wait_time: 1, + subresource_uris: Object.new ) instance_2 = Freeclimb::QueueResult.new( @@ -410,6 +437,8 @@ average_queue_removal_time: 1, + average_wait_time: 1, + subresource_uris: Object.new ) @@ -439,6 +468,8 @@ average_queue_removal_time: 1, + average_wait_time: 1, + subresource_uris: Object.new ) it "deserializes the data of uri" do @@ -481,6 +512,10 @@ expect(instance._deserialize("Integer", instance.average_queue_removal_time)).to be_a_kind_of(Integer) end + it "deserializes the data of average_wait_time" do + expect(instance._deserialize("Integer", instance.average_wait_time)).to be_a_kind_of(Integer) + end + it "deserializes the data of subresource_uris" do expect(instance._deserialize("Object", instance.subresource_uris)).to be_a_kind_of(Object) end @@ -509,6 +544,8 @@ average_queue_removal_time: 1, + average_wait_time: 1, + subresource_uris: Object.new ) expect(instance.to_s).to eq(instance.to_hash.to_s) @@ -538,6 +575,8 @@ average_queue_removal_time: 1, + average_wait_time: 1, + subresource_uris: Object.new ) expect(instance.to_hash).to be_a_kind_of(Hash) @@ -566,6 +605,8 @@ average_queue_removal_time: 1, + average_wait_time: 1, + subresource_uris: obj ) instance_2 = Freeclimb::QueueResult.new( @@ -589,6 +630,8 @@ average_queue_removal_time: 1, + average_wait_time: 1, + subresource_uris: obj ) expect(instance_1.to_hash).to eq(instance_2.to_hash) @@ -615,7 +658,9 @@ current_size: 1, - average_queue_removal_time: 1 + average_queue_removal_time: 1, + + average_wait_time: 1 ) it "returns uri in the form of hash" do expect(instance._to_hash(instance.uri)).to eq(instance.uri) @@ -647,6 +692,9 @@ it "returns average_queue_removal_time in the form of hash" do expect(instance._to_hash(instance.average_queue_removal_time)).to eq(instance.average_queue_removal_time) end + it "returns average_wait_time in the form of hash" do + expect(instance._to_hash(instance.average_wait_time)).to eq(instance.average_wait_time) + end it "returns subresource_uris in the form of hash" do expect(instance._to_hash(instance.subresource_uris)).to eq(instance.subresource_uris) end diff --git a/spec/models/request_type_spec.rb b/spec/models/request_type_spec.rb index 6644984..98aff14 100644 --- a/spec/models/request_type_spec.rb +++ b/spec/models/request_type_spec.rb @@ -233,6 +233,22 @@ end end + describe 'test attribute "AUDIO_STREAM"' do + it "should work" do + expect { Freeclimb::RequestType::AUDIO_STREAM = "audioStream" }.not_to raise_error + end + it "should serialize to enum" do + expectedValue = Freeclimb::RequestType::AUDIO_STREAM + calculatedValue = Freeclimb::RequestType.build_from_hash("audioStream") + expect(expectedValue).to eq(calculatedValue) + end + it "should deserialize to string" do + expectedValue = "audioStream" + calculatedValue = Freeclimb::RequestType::AUDIO_STREAM + expect(expectedValue).to eq(calculatedValue) + end + end + describe 'test attribute "REMOVE_FROM_QUEUE_NOTIFICATION"' do it "should work" do expect { Freeclimb::RequestType::REMOVE_FROM_QUEUE_NOTIFICATION = "removeFromQueueNotification" }.not_to raise_error diff --git a/yarn.lock b/yarn.lock index a920794..a4986a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -27,7 +27,7 @@ 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": +"@stoplight/http-spec@^7.0.3": version "7.1.0" resolved "https://registry.yarnpkg.com/@stoplight/http-spec/-/http-spec-7.1.0.tgz#516fec5f4b08cc93dadfb4969a6f9616165b0553" integrity sha512-Z2XqKX2SV8a1rrgSzFqccX2TolfcblT+l4pNvUU+THaLl50tKDoeidwWWZTzYUzqU0+UV97ponvqEbWWN3PaXg== @@ -86,7 +86,19 @@ "@types/json-schema" "^7.0.7" json-pointer "^0.6.1" -"@stoplight/json@3.20.0", "@stoplight/json@3.21.7", "@stoplight/json@^3.18.1": +"@stoplight/json@3.21.7": + version "3.21.7" + resolved "https://registry.yarnpkg.com/@stoplight/json/-/json-3.21.7.tgz#102f5fd11921984c96672ce4307850daa1cbfc7b" + integrity sha512-xcJXgKFqv/uCEgtGlPxy3tPA+4I+ZI4vAuMJ885+ThkTHFVkC+0Fm58lA9NlsyjnkpxFh4YiQWpH+KefHdbA0A== + dependencies: + "@stoplight/ordered-object-literal" "^1.0.3" + "@stoplight/path" "^1.3.2" + "@stoplight/types" "^13.6.0" + jsonc-parser "~2.2.1" + lodash "^4.17.21" + safe-stable-stringify "^1.1" + +"@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== @@ -108,33 +120,33 @@ resolved "https://registry.yarnpkg.com/@stoplight/path/-/path-1.3.2.tgz#96e591496b72fde0f0cdae01a61d64f065bd9ede" integrity sha512-lyIc6JUlUA8Ve5ELywPC8I2Sdnh1zc1zmbYgVarhXIp9YeAB0ReeqmGEOWNtlHkbP2DAA1AL65Wfn2ncjK/jtQ== -"@stoplight/prism-cli@5.6.0": - version "5.6.0" - resolved "https://registry.yarnpkg.com/@stoplight/prism-cli/-/prism-cli-5.6.0.tgz#fc6590936eb290bf60bfe289eb6ac3b3366c2031" - integrity sha512-BCCeWKjmjtFDQQv0qCATIE3L0HtnQQa3tUNvcMoCfZWIEe2McSGZkudckBsmGFfv6xycUrTkHSI/HNxhKYp5fg== +"@stoplight/prism-cli@5.14.2": + version "5.14.2" + resolved "https://registry.yarnpkg.com/@stoplight/prism-cli/-/prism-cli-5.14.2.tgz#4729662fddb08f4ce03a7ccb98817f368e3940e1" + integrity sha512-S/x47zQa7NgoGAD0Q1JlijV7GRDd1zP/FcIpxSh+cJRUUImfALJJm1R3ONLweP97oG/b9BrwRyC+0GNYuzrviw== dependencies: - "@stoplight/http-spec" "^7.0.2" - "@stoplight/json" "^3.18.1" + "@stoplight/json" "3.21.7" "@stoplight/json-schema-ref-parser" "9.2.7" - "@stoplight/prism-core" "^5.6.0" - "@stoplight/prism-http" "^5.6.0" - "@stoplight/prism-http-server" "^5.6.0" + "@stoplight/prism-core" "^5.8.0" + "@stoplight/prism-http" "5.12.0" + "@stoplight/prism-http-server" "^5.12.0" "@stoplight/types" "^14.1.0" chalk "^4.1.2" chokidar "^3.5.2" fp-ts "^2.11.5" - json-schema-faker "0.5.3" + json-schema-faker "0.5.8" + jsonrepair "^3.12.0" lodash "^4.17.21" node-fetch "^2.6.5" pino "^6.13.3" signale "^1.4.0" - split2 "^3.2.2" + split2 "^4.2.0" tslib "^2.3.1" uri-template-lite "^22.9.0" urijs "^1.19.11" yargs "^16.2.0" -"@stoplight/prism-core@^5.6.0", "@stoplight/prism-core@^5.8.0": +"@stoplight/prism-core@^5.8.0": version "5.8.0" resolved "https://registry.yarnpkg.com/@stoplight/prism-core/-/prism-core-5.8.0.tgz#850917e1c45bfcd92012b3b235d20e3087600372" integrity sha512-fmH7n6e0thzOGcD5uZBu/Xx1iFNfpc9ACTxPie+lFD54SJ214M2FIFXD7kV+NCFlC+w5OFw+lJRaYM859uMnAg== @@ -144,7 +156,7 @@ pino "^6.13.3" tslib "^2.3.1" -"@stoplight/prism-http-server@^5.6.0": +"@stoplight/prism-http-server@^5.12.0": version "5.12.2" resolved "https://registry.yarnpkg.com/@stoplight/prism-http-server/-/prism-http-server-5.12.2.tgz#d8de94f6b3506b464a5c89ff049b1e0fc9822ef9" integrity sha512-h7MpOuv/WPvf4MhQmXw3CygAZp64Ts0SOM4BdoafcgAOJZyvRAOjUNJeelGJsHYdPK0aB9NZsqsaKBtNfkYj+A== @@ -162,7 +174,7 @@ tslib "^2.3.1" type-is "^1.6.18" -"@stoplight/prism-http@^5.12.0", "@stoplight/prism-http@^5.6.0": +"@stoplight/prism-http@5.12.0", "@stoplight/prism-http@^5.12.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== @@ -528,13 +540,26 @@ fast-uri@^3.0.1: resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.0.tgz#66eecff6c764c0df9b762e62ca7edcfb53b4edfa" integrity sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA== -fast-xml-parser@^4.2.0, fast-xml-parser@^4.5.0: +fast-xml-builder@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-xml-builder/-/fast-xml-builder-1.0.0.tgz#a485d7e8381f1db983cf006f849d1066e2935241" + integrity sha512-fpZuDogrAgnyt9oDDz+5DBz0zgPdPZz6D4IR7iESxRXElrlGTRkHJ9eEt+SACRJwT0FNFrt71DFQIUFBJfX/uQ== + +fast-xml-parser@^4.2.0: 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" +fast-xml-parser@^5.3.8: + version "5.4.2" + resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-5.4.2.tgz#7fc66463b59260b0c5fd57edf46148a418bde68b" + integrity sha512-pw/6pIl4k0CSpElPEJhDppLzaixDEuWui2CUQQBH/ECDf7+y6YwA4Gf7Tyb0Rfe4DIMuZipYj4AEL0nACKglvQ== + dependencies: + fast-xml-builder "^1.0.0" + strnum "^2.1.2" + fastestsmallesttextencoderdecoder@^1.0.22: version "1.0.22" resolved "https://registry.yarnpkg.com/fastestsmallesttextencoderdecoder/-/fastestsmallesttextencoderdecoder-1.0.22.tgz#59b47e7b965f45258629cc6c127bf783281c5e93" @@ -657,11 +682,6 @@ iconv-lite@0.6.3: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" -inherits@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - io-ts@^2.2.16: version "2.2.22" resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-2.2.22.tgz#5ab0d3636fe8494a275f0266461ab019da4b8d0b" @@ -748,14 +768,6 @@ json-schema-compare@^0.2.2: dependencies: lodash "^4.17.4" -json-schema-faker@0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/json-schema-faker/-/json-schema-faker-0.5.3.tgz#92f8a102037acf68e1c8e3a2e7c85726d285512d" - integrity sha512-BeIrR0+YSrTbAR9dOMnjbFl1MvHyXnq+Wpdw1FpWZDHWKLzK229hZ5huyPcmzFUfVq1ODwf40WdGVoE266UBUg== - dependencies: - 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" @@ -783,7 +795,7 @@ 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@^10.1.0, jsonpath-plus@^7.2.0: +jsonpath-plus@^10.1.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== @@ -801,6 +813,11 @@ jsonpath-plus@^10.3.0: "@jsep-plugin/regex" "^1.0.4" jsep "^1.4.0" +jsonrepair@^3.12.0: + version "3.13.2" + resolved "https://registry.yarnpkg.com/jsonrepair/-/jsonrepair-3.13.2.tgz#cdc35669241482969d0ef5c7a2e4673abccd76e1" + integrity sha512-Leuly0nbM4R+S5SVJk3VHfw1oxnlEK9KygdZvfUtEtTawNDyzB4qa1xWTmFt1aeoA7sXZkVTRuIixJ8bAvqVUg== + liquid-json@0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/liquid-json/-/liquid-json-0.3.1.tgz#9155a18136d8a6b2615e5f16f9a2448ab6b50eea" @@ -1047,15 +1064,6 @@ quick-format-unescaped@^4.0.3: resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz#93ef6dd8d3453cbc7970dd614fad4c5954d6b5a7" integrity sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg== -readable-stream@^3.0.0: - version "3.6.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" - integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -1073,11 +1081,6 @@ require-from-string@^2.0.2: resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== -safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - safe-stable-stringify@^1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-1.1.1.tgz#c8a220ab525cd94e60ebf47ddc404d610dc5d84a" @@ -1115,12 +1118,10 @@ sonic-boom@^1.0.2: atomic-sleep "^1.0.0" flatstr "^1.0.12" -split2@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" - integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== - dependencies: - readable-stream "^3.0.0" +split2@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-4.2.0.tgz#c9c5920904d148bab0b9f67145f245a86aadbfa4" + integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg== sprintf-js@~1.0.2: version "1.0.3" @@ -1136,13 +1137,6 @@ string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -1160,6 +1154,11 @@ strnum@^1.0.5: resolved "https://registry.yarnpkg.com/strnum/-/strnum-1.1.2.tgz#57bca4fbaa6f271081715dbc9ed7cee5493e28e4" integrity sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA== +strnum@^2.1.2: + version "2.2.0" + resolved "https://registry.yarnpkg.com/strnum/-/strnum-2.2.0.tgz#8b582b637e4621f62ff714493e0ce30846f903a6" + integrity sha512-Y7Bj8XyJxnPAORMZj/xltsfo55uOiyHcU2tnAVzHUnSJR/KsEX+9RoDeXEnsXtl/CX4fAcrt64gZ13aGaWPeBg== + supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -1214,11 +1213,6 @@ urijs@^1.19.11: resolved "https://registry.yarnpkg.com/urijs/-/urijs-1.19.11.tgz#204b0d6b605ae80bea54bea39280cdb7c9f923cc" integrity sha512-HXgFDgDommxn5/bIv0cnQZsPhHDA90NPHD6+c/v21U5+Sx5hoP8+dP9IZXBU1gIfvdRfhG8cel9QNPeionfcCQ== -util-deprecate@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - utility-types@^3.10.0: version "3.11.0" resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.11.0.tgz#607c40edb4f258915e901ea7995607fdf319424c"