diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 3c6d405..7577686 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -45,6 +45,14 @@ docs/DefaultApi.md docs/Dequeue.md docs/DequeueWebhook.md docs/Enqueue.md +docs/ExportList.md +docs/ExportOutputType.md +docs/ExportRequest.md +docs/ExportRequestOutput.md +docs/ExportResourceType.md +docs/ExportResult.md +docs/ExportResultOutput.md +docs/ExportStatus.md docs/FilterLogsRequest.md docs/GetDigits.md docs/GetDigitsReason.md @@ -191,6 +199,14 @@ lib/freeclimb/models/create_web_rtc_token.rb lib/freeclimb/models/dequeue.rb lib/freeclimb/models/dequeue_webhook.rb lib/freeclimb/models/enqueue.rb +lib/freeclimb/models/export_list.rb +lib/freeclimb/models/export_output_type.rb +lib/freeclimb/models/export_request.rb +lib/freeclimb/models/export_request_output.rb +lib/freeclimb/models/export_resource_type.rb +lib/freeclimb/models/export_result.rb +lib/freeclimb/models/export_result_output.rb +lib/freeclimb/models/export_status.rb lib/freeclimb/models/filter_logs_request.rb lib/freeclimb/models/get_digits.rb lib/freeclimb/models/get_digits_reason.rb @@ -333,6 +349,14 @@ spec/models/create_web_rtc_token_spec.rb spec/models/dequeue_spec.rb spec/models/dequeue_webhook_spec.rb spec/models/enqueue_spec.rb +spec/models/export_list_spec.rb +spec/models/export_output_type_spec.rb +spec/models/export_request_output_spec.rb +spec/models/export_request_spec.rb +spec/models/export_resource_type_spec.rb +spec/models/export_result_output_spec.rb +spec/models/export_result_spec.rb +spec/models/export_status_spec.rb spec/models/filter_logs_request_spec.rb spec/models/get_digits_reason_spec.rb spec/models/get_digits_spec.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 0316684..e7a1067 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,20 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] None + - +## [5.3.0] - 2025-09-23 + +### Added + +- Add models for ExportResult and ExportRequest + +### Changed + +- CallResult.callStatus -> CallResult.status +- CreateConference now includes parentCallId + + ## [5.2.0] - 2025-02-18 diff --git a/Gemfile.lock b/Gemfile.lock index 7467e10..029199b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - freeclimb (5.2.0) + freeclimb (5.3.0) typhoeus (~> 1.0, >= 1.0.1) GEM @@ -74,7 +74,7 @@ GEM rainbow (3.1.1) rake (13.0.6) regexp_parser (2.10.0) - rexml (3.4.0) + rexml (3.4.4) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) diff --git a/README.md b/README.md index 48f5cf4..77a90fe 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.2.0 +- Package version: 5.3.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.2.0' + gem 'freeclimb', '~> 5.3.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.2.0.gem +gem install ./freeclimb-5.3.0.gem ``` -(for development, run `gem install --dev ./freeclimb-5.2.0.gem` to install the development dependencies) +(for development, run `gem install --dev ./freeclimb-5.3.0.gem` to install the development dependencies) ## Getting Started @@ -103,13 +103,16 @@ Class | Method | HTTP request | Description *Freeclimb::DefaultApi* | [**create_a_conference**](docs/DefaultApi.md#create_a_conference) | **POST** /Accounts/{accountId}/Conferences | Create a Conference *Freeclimb::DefaultApi* | [**create_a_queue**](docs/DefaultApi.md#create_a_queue) | **POST** /Accounts/{accountId}/Queues | Create a Queue *Freeclimb::DefaultApi* | [**create_an_application**](docs/DefaultApi.md#create_an_application) | **POST** /Accounts/{accountId}/Applications | Create an application +*Freeclimb::DefaultApi* | [**create_export**](docs/DefaultApi.md#create_export) | **POST** /Accounts/{accountId}/Exports | Create an Export *Freeclimb::DefaultApi* | [**create_knowledge_base_completion**](docs/DefaultApi.md#create_knowledge_base_completion) | **POST** /Accounts/{accountId}/KnowledgeBases/{knowledgeBaseId}/Completion | Query the knowledge base *Freeclimb::DefaultApi* | [**delete_a_recording**](docs/DefaultApi.md#delete_a_recording) | **DELETE** /Accounts/{accountId}/Recordings/{recordingId} | Delete a Recording *Freeclimb::DefaultApi* | [**delete_an_application**](docs/DefaultApi.md#delete_an_application) | **DELETE** /Accounts/{accountId}/Applications/{applicationId} | Delete an application +*Freeclimb::DefaultApi* | [**delete_an_export**](docs/DefaultApi.md#delete_an_export) | **DELETE** /Accounts/{accountId}/Exports/{exportId} | Delete an Export *Freeclimb::DefaultApi* | [**delete_an_incoming_number**](docs/DefaultApi.md#delete_an_incoming_number) | **DELETE** /Accounts/{accountId}/IncomingPhoneNumbers/{phoneNumberId} | Delete an Incoming Number *Freeclimb::DefaultApi* | [**dequeue_a_member**](docs/DefaultApi.md#dequeue_a_member) | **POST** /Accounts/{accountId}/Queues/{queueId}/Members/{callId} | Dequeue a Member *Freeclimb::DefaultApi* | [**dequeue_head_member**](docs/DefaultApi.md#dequeue_head_member) | **POST** /Accounts/{accountId}/Queues/{queueId}/Members/Front | Dequeue Head Member *Freeclimb::DefaultApi* | [**download_a_recording_file**](docs/DefaultApi.md#download_a_recording_file) | **GET** /Accounts/{accountId}/Recordings/{recordingId}/Download | Download a Recording File +*Freeclimb::DefaultApi* | [**download_an_export**](docs/DefaultApi.md#download_an_export) | **GET** /Accounts/{accountId}/Exports/{exportId}/Download | Download an Export *Freeclimb::DefaultApi* | [**filter_logs**](docs/DefaultApi.md#filter_logs) | **POST** /Accounts/{accountId}/Logs | Filter Logs *Freeclimb::DefaultApi* | [**get_a_call**](docs/DefaultApi.md#get_a_call) | **GET** /Accounts/{accountId}/Calls/{callId} | Get a Call *Freeclimb::DefaultApi* | [**get_a_conference**](docs/DefaultApi.md#get_a_conference) | **GET** /Accounts/{accountId}/Conferences/{conferenceId} | Get a Conference @@ -119,6 +122,7 @@ Class | Method | HTTP request | Description *Freeclimb::DefaultApi* | [**get_a_recording**](docs/DefaultApi.md#get_a_recording) | **GET** /Accounts/{accountId}/Recordings/{recordingId} | Get a Recording *Freeclimb::DefaultApi* | [**get_an_account**](docs/DefaultApi.md#get_an_account) | **GET** /Accounts/{accountId} | Get an Account *Freeclimb::DefaultApi* | [**get_an_application**](docs/DefaultApi.md#get_an_application) | **GET** /Accounts/{accountId}/Applications/{applicationId} | Get an Application +*Freeclimb::DefaultApi* | [**get_an_export**](docs/DefaultApi.md#get_an_export) | **GET** /Accounts/{accountId}/Exports/{exportId} | Get an Export *Freeclimb::DefaultApi* | [**get_an_incoming_number**](docs/DefaultApi.md#get_an_incoming_number) | **GET** /Accounts/{accountId}/IncomingPhoneNumbers/{phoneNumberId} | Get an Incoming Number *Freeclimb::DefaultApi* | [**get_an_sms_message**](docs/DefaultApi.md#get_an_sms_message) | **GET** /Accounts/{accountId}/Messages/{messageId} | Get an SMS Message *Freeclimb::DefaultApi* | [**get_head_member**](docs/DefaultApi.md#get_head_member) | **GET** /Accounts/{accountId}/Queues/{queueId}/Members/Front | Get Head Member @@ -139,6 +143,7 @@ Class | Method | HTTP request | Description *Freeclimb::DefaultApi* | [**list_calls**](docs/DefaultApi.md#list_calls) | **GET** /Accounts/{accountId}/Calls | List Calls *Freeclimb::DefaultApi* | [**list_conference_recordings**](docs/DefaultApi.md#list_conference_recordings) | **GET** /Accounts/{accountId}/Conferences/{conferenceId}/Recordings | List Conference Recordings *Freeclimb::DefaultApi* | [**list_conferences**](docs/DefaultApi.md#list_conferences) | **GET** /Accounts/{accountId}/Conferences | List Conferences +*Freeclimb::DefaultApi* | [**list_exports**](docs/DefaultApi.md#list_exports) | **GET** /Accounts/{accountId}/Exports | List Exports *Freeclimb::DefaultApi* | [**list_incoming_numbers**](docs/DefaultApi.md#list_incoming_numbers) | **GET** /Accounts/{accountId}/IncomingPhoneNumbers | List Incoming Numbers *Freeclimb::DefaultApi* | [**list_members**](docs/DefaultApi.md#list_members) | **GET** /Accounts/{accountId}/Queues/{queueId}/Members | List Members *Freeclimb::DefaultApi* | [**list_participants**](docs/DefaultApi.md#list_participants) | **GET** /Accounts/{accountId}/Conferences/{conferenceId}/Participants | List Participants @@ -200,6 +205,14 @@ Class | Method | HTTP request | Description - [Freeclimb::Dequeue](docs/Dequeue.md) - [Freeclimb::DequeueWebhook](docs/DequeueWebhook.md) - [Freeclimb::Enqueue](docs/Enqueue.md) + - [Freeclimb::ExportList](docs/ExportList.md) + - [Freeclimb::ExportOutputType](docs/ExportOutputType.md) + - [Freeclimb::ExportRequest](docs/ExportRequest.md) + - [Freeclimb::ExportRequestOutput](docs/ExportRequestOutput.md) + - [Freeclimb::ExportResourceType](docs/ExportResourceType.md) + - [Freeclimb::ExportResult](docs/ExportResult.md) + - [Freeclimb::ExportResultOutput](docs/ExportResultOutput.md) + - [Freeclimb::ExportStatus](docs/ExportStatus.md) - [Freeclimb::FilterLogsRequest](docs/FilterLogsRequest.md) - [Freeclimb::GetDigits](docs/GetDigits.md) - [Freeclimb::GetDigitsReason](docs/GetDigitsReason.md) diff --git a/docs/CallResult.md b/docs/CallResult.md index c25a675..03c4a47 100644 --- a/docs/CallResult.md +++ b/docs/CallResult.md @@ -14,7 +14,7 @@ | **from** | **String** | Phone number that initiated this Call. | [optional] | | **to** | **String** | Phone number that received this Call. | [optional] | | **phone_number_id** | **String** | If the Call was inbound, this is the ID of the IncomingPhoneNumber that received the Call (DNIS). If the Call was outbound, this is the ID of the phone number from which the Call was placed (ANI). | [optional] | -| **call_status** | [**CallStatus**](CallStatus.md) | | [optional] | +| **status** | [**CallStatus**](CallStatus.md) | | [optional] | | **start_time** | **String** | Start time of the Call (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call has not yet been dialed. | [optional] | | **connect_time** | **String** | Time the Call was answered (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call has not yet been dialed. | [optional] | | **end_time** | **String** | End time of the Call (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call did not complete successfully. | [optional] | @@ -41,7 +41,7 @@ instance = Freeclimb::CallResult.new( from: null, to: null, phone_number_id: null, - call_status: null, + status: null, start_time: null, connect_time: null, end_time: null, diff --git a/docs/CreateConference.md b/docs/CreateConference.md index 30b55af..487c83f 100644 --- a/docs/CreateConference.md +++ b/docs/CreateConference.md @@ -5,11 +5,12 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **action_url** | **String** | This URL is invoked once the Conference is successfully created. Actions on the Conference, such as adding Participants, can be performed via the PerCL script returned in the response. | | -| **_alias** | **Boolean** | Descriptive name for the Conference. | [optional] | +| **_alias** | **String** | Descriptive name for the Conference. | [optional] | | **play_beep** | [**PlayBeep**](PlayBeep.md) | | [optional] | | **record** | **Boolean** | When set to `true`, the entire Conference is recorded. The `statusCallbackUrl` of the Conference will receive a `conferenceRecordingEnded` Webhook when the Conference transitions from the `inProgress` to empty state. | [optional] | | **status_callback_url** | **String** | This URL is invoked when the status of the Conference changes or when a recording of the Conference has become available. | [optional] | | **wait_url** | **String** | If specified, this URL provides the custom hold music for the Conference when it is in the populated state. This attribute is always fetched using HTTP GET and is fetched just once – when the Conference is created. The URL must be an audio file that is reachable and readable by FreeClimb. | [optional] | +| **parent_call_id** | **String** | ID of the Call that created this leg (child call). | [optional] | ## Example @@ -22,7 +23,8 @@ instance = Freeclimb::CreateConference.new( play_beep: null, record: null, status_callback_url: null, - wait_url: null + wait_url: null, + parent_call_id: null ) ``` diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index 2397d06..f9a9480 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -12,12 +12,16 @@ All URIs are relative to *https://www.freeclimb.com/apiserver* | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | | [**create_an_application**](DefaultApi.md#create_an_application) | **POST** /Accounts/{accountId}/Applications | Create an application | | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | +| [**create_export**](DefaultApi.md#create_export) | **POST** /Accounts/{accountId}/Exports | Create an Export | +| [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | | [**create_knowledge_base_completion**](DefaultApi.md#create_knowledge_base_completion) | **POST** /Accounts/{accountId}/KnowledgeBases/{knowledgeBaseId}/Completion | Query the knowledge base | | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | | [**delete_a_recording**](DefaultApi.md#delete_a_recording) | **DELETE** /Accounts/{accountId}/Recordings/{recordingId} | Delete a Recording | | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | | [**delete_an_application**](DefaultApi.md#delete_an_application) | **DELETE** /Accounts/{accountId}/Applications/{applicationId} | Delete an application | | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | +| [**delete_an_export**](DefaultApi.md#delete_an_export) | **DELETE** /Accounts/{accountId}/Exports/{exportId} | Delete an Export | +| [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | | [**delete_an_incoming_number**](DefaultApi.md#delete_an_incoming_number) | **DELETE** /Accounts/{accountId}/IncomingPhoneNumbers/{phoneNumberId} | Delete an Incoming Number | | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | | [**dequeue_a_member**](DefaultApi.md#dequeue_a_member) | **POST** /Accounts/{accountId}/Queues/{queueId}/Members/{callId} | Dequeue a Member | @@ -26,6 +30,8 @@ All URIs are relative to *https://www.freeclimb.com/apiserver* | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | | [**download_a_recording_file**](DefaultApi.md#download_a_recording_file) | **GET** /Accounts/{accountId}/Recordings/{recordingId}/Download | Download a Recording File | | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | +| [**download_an_export**](DefaultApi.md#download_an_export) | **GET** /Accounts/{accountId}/Exports/{exportId}/Download | Download an Export | +| [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | | [**filter_logs**](DefaultApi.md#filter_logs) | **POST** /Accounts/{accountId}/Logs | Filter Logs | | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | | [**get_a_call**](DefaultApi.md#get_a_call) | **GET** /Accounts/{accountId}/Calls/{callId} | Get a Call | @@ -44,6 +50,8 @@ All URIs are relative to *https://www.freeclimb.com/apiserver* | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | | [**get_an_application**](DefaultApi.md#get_an_application) | **GET** /Accounts/{accountId}/Applications/{applicationId} | Get an Application | | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | +| [**get_an_export**](DefaultApi.md#get_an_export) | **GET** /Accounts/{accountId}/Exports/{exportId} | Get an Export | +| [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | | [**get_an_incoming_number**](DefaultApi.md#get_an_incoming_number) | **GET** /Accounts/{accountId}/IncomingPhoneNumbers/{phoneNumberId} | Get an Incoming Number | | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | | [**get_an_sms_message**](DefaultApi.md#get_an_sms_message) | **GET** /Accounts/{accountId}/Messages/{messageId} | Get an SMS Message | @@ -84,6 +92,8 @@ All URIs are relative to *https://www.freeclimb.com/apiserver* | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | | [**list_conferences**](DefaultApi.md#list_conferences) | **GET** /Accounts/{accountId}/Conferences | List Conferences | | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | +| [**list_exports**](DefaultApi.md#list_exports) | **GET** /Accounts/{accountId}/Exports | List Exports | +| [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | | [**list_incoming_numbers**](DefaultApi.md#list_incoming_numbers) | **GET** /Accounts/{accountId}/IncomingPhoneNumbers | List Incoming Numbers | | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource | | [**list_members**](DefaultApi.md#list_members) | **GET** /Accounts/{accountId}/Queues/{queueId}/Members | List Members | @@ -403,6 +413,77 @@ end - **Accept**: application/json +## create_export + +Create an Export + +### Examples + +```ruby +require 'time' +require 'freeclimb' +# setup authorization +Freeclimb.configure do |config| + # Configure HTTP basic authorization: fc + config.username = 'ACCOUNT_ID' + config.password = 'API_KEY' +end + +api_instance = Freeclimb::DefaultApi.new + +opts = { + export_request: Freeclimb::ExportRequest.new({resource_type: Freeclimb::ExportResourceType::MESSAGES, output: Freeclimb::ExportRequestOutput.new({type: Freeclimb::ExportOutputType::CSV})}) # ExportRequest | A JSON object containing export creation parameters +} + +begin + + # Create an Export + result = api_instance.create_export(opts) + p result +rescue Freeclimb::ApiError => e + puts "Error when calling DefaultApi->create_export: #{e}" +end +``` + +#### Using the create_export_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_export_with_http_info(account_id, opts) + +```ruby +begin + # Create an Export + data, status_code, headers = api_instance.create_export_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Freeclimb::ApiError => e + puts "Error when calling DefaultApi->create_export_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **export_request** | [**ExportRequest**](ExportRequest.md) | A JSON object containing export creation parameters | [optional] | + + +### Return type + +[**ExportResult**](ExportResult.md) + +### Authorization + +[fc](../README.md#fc) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + ## create_knowledge_base_completion Query the knowledge base @@ -615,6 +696,75 @@ nil (empty response body) - **Accept**: Not defined +## delete_an_export + +Delete an Export + +### Examples + +```ruby +require 'time' +require 'freeclimb' +# setup authorization +Freeclimb.configure do |config| + # Configure HTTP basic authorization: fc + config.username = 'ACCOUNT_ID' + config.password = 'API_KEY' +end + +api_instance = Freeclimb::DefaultApi.new + +export_id = 'export_id_example' # String | A string that uniquely identifies this export resource. + + +begin + + # Delete an Export + api_instance.delete_an_export(export_id) +rescue Freeclimb::ApiError => e + puts "Error when calling DefaultApi->delete_an_export: #{e}" +end +``` + +#### Using the delete_an_export_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_an_export_with_http_info(account_id, export_id) + +```ruby +begin + # Delete an Export + data, status_code, headers = api_instance.delete_an_export_with_http_info(export_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue Freeclimb::ApiError => e + puts "Error when calling DefaultApi->delete_an_export_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **export_id** | **String** | A string that uniquely identifies this export resource. | | + + +### Return type + +nil (empty response body) + +### Authorization + +[fc](../README.md#fc) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + ## delete_an_incoming_number Delete an Incoming Number @@ -897,6 +1047,76 @@ end - **Accept**: audio/x-wav +## download_an_export + +Download an Export + +### Examples + +```ruby +require 'time' +require 'freeclimb' +# setup authorization +Freeclimb.configure do |config| + # Configure HTTP basic authorization: fc + config.username = 'ACCOUNT_ID' + config.password = 'API_KEY' +end + +api_instance = Freeclimb::DefaultApi.new + +export_id = 'export_id_example' # String | A string that uniquely identifies this export resource. + + +begin + + # Download an Export + result = api_instance.download_an_export(export_id) + p result +rescue Freeclimb::ApiError => e + puts "Error when calling DefaultApi->download_an_export: #{e}" +end +``` + +#### Using the download_an_export_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> download_an_export_with_http_info(account_id, export_id) + +```ruby +begin + # Download an Export + data, status_code, headers = api_instance.download_an_export_with_http_info(export_id) + p status_code # => 2xx + p headers # => { ... } + p data # => String +rescue Freeclimb::ApiError => e + puts "Error when calling DefaultApi->download_an_export_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **export_id** | **String** | A string that uniquely identifies this export resource. | | + + +### Return type + +**String** + +### Authorization + +[fc](../README.md#fc) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/csv + + ## filter_logs Filter Logs @@ -1530,6 +1750,76 @@ end - **Accept**: application/json +## get_an_export + +Get an Export + +### Examples + +```ruby +require 'time' +require 'freeclimb' +# setup authorization +Freeclimb.configure do |config| + # Configure HTTP basic authorization: fc + config.username = 'ACCOUNT_ID' + config.password = 'API_KEY' +end + +api_instance = Freeclimb::DefaultApi.new + +export_id = 'export_id_example' # String | A string that uniquely identifies this export resource. + + +begin + + # Get an Export + result = api_instance.get_an_export(export_id) + p result +rescue Freeclimb::ApiError => e + puts "Error when calling DefaultApi->get_an_export: #{e}" +end +``` + +#### Using the get_an_export_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_an_export_with_http_info(account_id, export_id) + +```ruby +begin + # Get an Export + data, status_code, headers = api_instance.get_an_export_with_http_info(export_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Freeclimb::ApiError => e + puts "Error when calling DefaultApi->get_an_export_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **export_id** | **String** | A string that uniquely identifies this export resource. | | + + +### Return type + +[**ExportResult**](ExportResult.md) + +### Authorization + +[fc](../README.md#fc) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + ## get_an_incoming_number Get an Incoming Number @@ -2764,7 +3054,9 @@ opts = { start_time: 'start_time_example', # String | Only show Calls that started at or after this time, given as YYYY-MM-DD hh:mm:ss. end_time: 'end_time_example', # String | Only show Calls that ended at or before this time, given as YYYY-MM- DD hh:mm:ss. 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. + 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. } begin @@ -2807,6 +3099,8 @@ end | **end_time** | **String** | Only show Calls that ended at or before this time, given as YYYY-MM- DD hh:mm:ss. | [optional] | | **parent_call_id** | **String** | Only show Calls spawned by the call with this ID. | [optional] | | **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] | ### Return type @@ -2976,6 +3270,79 @@ end - **Accept**: application/json +## list_exports + +List Exports + +### Examples + +```ruby +require 'time' +require 'freeclimb' +# setup authorization +Freeclimb.configure do |config| + # Configure HTTP basic authorization: fc + config.username = 'ACCOUNT_ID' + config.password = 'API_KEY' +end + +api_instance = Freeclimb::DefaultApi.new + +opts = { + status: Freeclimb::ExportStatus::INTAKING, # ExportStatus | Status of export + cursor: 'cursor_example' # String | Used to reference pages of a list of exports +} + +begin + + # List Exports + result = api_instance.list_exports(opts) + p result +rescue Freeclimb::ApiError => e + puts "Error when calling DefaultApi->list_exports: #{e}" +end +``` + +#### Using the list_exports_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> list_exports_with_http_info(account_id, opts) + +```ruby +begin + # List Exports + data, status_code, headers = api_instance.list_exports_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue Freeclimb::ApiError => e + puts "Error when calling DefaultApi->list_exports_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **status** | [**ExportStatus**](.md) | Status of export | [optional] | +| **cursor** | **String** | Used to reference pages of a list of exports | [optional] | + + +### Return type + +[**ExportList**](ExportList.md) + +### Authorization + +[fc](../README.md#fc) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + ## list_incoming_numbers List Incoming Numbers diff --git a/docs/ExportList.md b/docs/ExportList.md new file mode 100644 index 0000000..ab6928b --- /dev/null +++ b/docs/ExportList.md @@ -0,0 +1,32 @@ +# Freeclimb::ExportList + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **total** | **Integer** | Total amount of requested resource. | [optional] | +| **start** | **Integer** | Resource index at start of current page | [optional] | +| **_end** | **Integer** | Resource index at end of current page | [optional] | +| **page** | **Integer** | Current page | [optional] | +| **num_pages** | **Integer** | Total number of pages | [optional] | +| **page_size** | **Integer** | Number of items per page | [optional] | +| **next_page_uri** | **String** | Uri to retrieve the next page of items | [optional] | +| **exports** | [**Array<ExportResult>**](ExportResult.md) | | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::ExportList.new( + total: null, + start: null, + _end: null, + page: null, + num_pages: null, + page_size: null, + next_page_uri: null, + exports: null +) +``` + diff --git a/docs/ExportOutputType.md b/docs/ExportOutputType.md new file mode 100644 index 0000000..7a32e82 --- /dev/null +++ b/docs/ExportOutputType.md @@ -0,0 +1,16 @@ +# Freeclimb::ExportOutputType + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **CSV** | **ExportOutputType** | | Represented in Ruby as "csv" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::ExportOutputType::[NAME OF ENUM] +``` + diff --git a/docs/ExportRequest.md b/docs/ExportRequest.md new file mode 100644 index 0000000..ae3c3cc --- /dev/null +++ b/docs/ExportRequest.md @@ -0,0 +1,24 @@ +# Freeclimb::ExportRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **resource_type** | [**ExportResourceType**](ExportResourceType.md) | | | +| **format** | **Array<String>** | | [optional] | +| **output** | [**ExportRequestOutput**](ExportRequestOutput.md) | | | +| **query** | **Object** | | [optional] | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::ExportRequest.new( + resource_type: null, + format: null, + output: null, + query: null +) +``` + diff --git a/docs/ExportRequestOutput.md b/docs/ExportRequestOutput.md new file mode 100644 index 0000000..ad38f57 --- /dev/null +++ b/docs/ExportRequestOutput.md @@ -0,0 +1,18 @@ +# Freeclimb::ExportRequestOutput + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | [**ExportOutputType**](ExportOutputType.md) | | | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::ExportRequestOutput.new( + type: null +) +``` + diff --git a/docs/ExportResourceType.md b/docs/ExportResourceType.md new file mode 100644 index 0000000..bca99e5 --- /dev/null +++ b/docs/ExportResourceType.md @@ -0,0 +1,17 @@ +# Freeclimb::ExportResourceType + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **MESSAGES** | **ExportResourceType** | | Represented in Ruby as "Messages" | +| **CALLS** | **ExportResourceType** | | Represented in Ruby as "Calls" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::ExportResourceType::[NAME OF ENUM] +``` + diff --git a/docs/ExportResult.md b/docs/ExportResult.md new file mode 100644 index 0000000..75f6d5f --- /dev/null +++ b/docs/ExportResult.md @@ -0,0 +1,40 @@ +# Freeclimb::ExportResult + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **account_id** | **String** | String that uniquely identifies this account resource. | | +| **uri** | **String** | | | +| **date_created** | **String** | | | +| **date_updated** | **String** | | | +| **revision** | **Integer** | | | +| **export_id** | **String** | String that uniquely identifies this export resource | | +| **status** | [**ExportStatus**](ExportStatus.md) | | | +| **size** | **Integer** | | | +| **resource_type** | [**ExportResourceType**](ExportResourceType.md) | | | +| **query** | **Object** | Query params used to filter exported documents | | +| **format** | **Array<String>** | Desired fields of exported documents | | +| **output** | [**ExportResultOutput**](ExportResultOutput.md) | | | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::ExportResult.new( + account_id: null, + uri: null, + date_created: null, + date_updated: null, + revision: null, + export_id: null, + status: null, + size: null, + resource_type: null, + query: null, + format: null, + output: null +) +``` + diff --git a/docs/ExportResultOutput.md b/docs/ExportResultOutput.md new file mode 100644 index 0000000..710bf69 --- /dev/null +++ b/docs/ExportResultOutput.md @@ -0,0 +1,18 @@ +# Freeclimb::ExportResultOutput + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | [**ExportOutputType**](ExportOutputType.md) | | | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::ExportResultOutput.new( + type: null +) +``` + diff --git a/docs/ExportStatus.md b/docs/ExportStatus.md new file mode 100644 index 0000000..9949b7f --- /dev/null +++ b/docs/ExportStatus.md @@ -0,0 +1,21 @@ +# Freeclimb::ExportStatus + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **INTAKING** | **ExportStatus** | | Represented in Ruby as "intaking" | +| **QUEUED** | **ExportStatus** | | Represented in Ruby as "queued" | +| **IN_PROGRESS** | **ExportStatus** | | Represented in Ruby as "inProgress" | +| **COMPLETED** | **ExportStatus** | | Represented in Ruby as "completed" | +| **FAILED** | **ExportStatus** | | Represented in Ruby as "failed" | +| **DELETED** | **ExportStatus** | | Represented in Ruby as "deleted" | + +## Example + +```ruby +require 'freeclimb' + +instance = Freeclimb::ExportStatus::[NAME OF ENUM] +``` + diff --git a/lib/freeclimb.rb b/lib/freeclimb.rb index 210e0c2..bcb20e3 100644 --- a/lib/freeclimb.rb +++ b/lib/freeclimb.rb @@ -43,6 +43,14 @@ require "freeclimb/models/conference_status" require "freeclimb/models/create_conference_request" require "freeclimb/models/create_web_rtc_token" +require "freeclimb/models/export_list" +require "freeclimb/models/export_output_type" +require "freeclimb/models/export_request" +require "freeclimb/models/export_request_output" +require "freeclimb/models/export_resource_type" +require "freeclimb/models/export_result" +require "freeclimb/models/export_result_output" +require "freeclimb/models/export_status" require "freeclimb/models/filter_logs_request" require "freeclimb/models/get_digits_reason" require "freeclimb/models/get_speech_reason" diff --git a/lib/freeclimb/api/default_api.rb b/lib/freeclimb/api/default_api.rb index 6701347..8d283ac 100644 --- a/lib/freeclimb/api/default_api.rb +++ b/lib/freeclimb/api/default_api.rb @@ -276,6 +276,68 @@ def create_an_application_with_http_info(opts = {}) [data, status_code, headers] end + # Create an Export + # @param [Hash] opts the optional parameters + # @option opts [ExportRequest] :export_request A JSON object containing export creation parameters + # @return [ExportResult] + def create_export(opts = {}) + data, _status_code, _headers = create_export_with_http_info(opts) + data + end + + # Create an Export + # @param [Hash] opts the optional parameters + # @option opts [ExportRequest] :export_request A JSON object containing export creation parameters + # @return [Array<(ExportResult, Integer, Hash)>] ExportResult data, response status code and response headers + def create_export_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: DefaultApi.create_export ..." + end + # resource path + local_var_path = "/Accounts/{accountId}/Exports".sub("{" + "accountId" + "}", CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params["Accept"] = @api_client.select_header_accept(["application/json"]) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(["application/json"]) + if !content_type.nil? + header_params["Content-Type"] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:export_request]) + + # return_type + return_type = opts[:debug_return_type] || "ExportResult" + + # auth_names + auth_names = opts[:debug_auth_names] || ["fc"] + + new_options = opts.merge( + operation: :"DefaultApi.create_export", + header_params: header_params, + query_params: query_params, + form_params: form_params, + body: post_body, + auth_names: auth_names, + return_type: return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#create_export\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + [data, status_code, headers] + end + # Query the knowledge base # @param knowledge_base_id [String] A string that uniquely identifies the KnowledgeBase resource. # @param [Hash] opts the optional parameters @@ -465,6 +527,66 @@ def delete_an_application_with_http_info(application_id, opts = {}) [data, status_code, headers] end + # Delete an Export + # @param export_id [String] A string that uniquely identifies this export resource. + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_an_export(export_id, opts = {}) + delete_an_export_with_http_info(export_id, opts) + nil + end + + # Delete an Export + # @param export_id [String] A string that uniquely identifies this export resource. + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_an_export_with_http_info(export_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: DefaultApi.delete_an_export ..." + end + + # verify the required parameter 'export_id' is set + if @api_client.config.client_side_validation && export_id.nil? + fail ArgumentError, "Missing the required parameter 'export_id' when calling DefaultApi.delete_an_export" + end + # resource path + local_var_path = "/Accounts/{accountId}/Exports/{exportId}".sub("{" + "accountId" + "}", CGI.escape(account_id.to_s)).sub("{" + "exportId" + "}", CGI.escape(export_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ["fc"] + + new_options = opts.merge( + operation: :"DefaultApi.delete_an_export", + header_params: header_params, + query_params: query_params, + form_params: form_params, + body: post_body, + auth_names: auth_names, + return_type: return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#delete_an_export\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + [data, status_code, headers] + end + # Delete an Incoming Number # @param phone_number_id [String] String that uniquely identifies this phone number resource. # @param [Hash] opts the optional parameters @@ -718,6 +840,68 @@ def download_a_recording_file_with_http_info(recording_id, opts = {}) [data, status_code, headers] end + # Download an Export + # @param export_id [String] A string that uniquely identifies this export resource. + # @param [Hash] opts the optional parameters + # @return [String] + def download_an_export(export_id, opts = {}) + data, _status_code, _headers = download_an_export_with_http_info(export_id, opts) + data + end + + # Download an Export + # @param export_id [String] A string that uniquely identifies this export resource. + # @param [Hash] opts the optional parameters + # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers + def download_an_export_with_http_info(export_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: DefaultApi.download_an_export ..." + end + + # verify the required parameter 'export_id' is set + if @api_client.config.client_side_validation && export_id.nil? + fail ArgumentError, "Missing the required parameter 'export_id' when calling DefaultApi.download_an_export" + end + # resource path + local_var_path = "/Accounts/{accountId}/Exports/{exportId}/Download".sub("{" + "accountId" + "}", CGI.escape(account_id.to_s)).sub("{" + "exportId" + "}", CGI.escape(export_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params["Accept"] = @api_client.select_header_accept(["text/csv"]) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || "String" + + # auth_names + auth_names = opts[:debug_auth_names] || ["fc"] + + new_options = opts.merge( + operation: :"DefaultApi.download_an_export", + header_params: header_params, + query_params: query_params, + form_params: form_params, + body: post_body, + auth_names: auth_names, + return_type: return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#download_an_export\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + [data, status_code, headers] + end + # Filter Logs # @param filter_logs_request [FilterLogsRequest] Filter logs request paramters # @param [Hash] opts the optional parameters @@ -1288,6 +1472,68 @@ def get_an_application_with_http_info(application_id, opts = {}) [data, status_code, headers] end + # Get an Export + # @param export_id [String] A string that uniquely identifies this export resource. + # @param [Hash] opts the optional parameters + # @return [ExportResult] + def get_an_export(export_id, opts = {}) + data, _status_code, _headers = get_an_export_with_http_info(export_id, opts) + data + end + + # Get an Export + # @param export_id [String] A string that uniquely identifies this export resource. + # @param [Hash] opts the optional parameters + # @return [Array<(ExportResult, Integer, Hash)>] ExportResult data, response status code and response headers + def get_an_export_with_http_info(export_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: DefaultApi.get_an_export ..." + end + + # verify the required parameter 'export_id' is set + if @api_client.config.client_side_validation && export_id.nil? + fail ArgumentError, "Missing the required parameter 'export_id' when calling DefaultApi.get_an_export" + end + # resource path + local_var_path = "/Accounts/{accountId}/Exports/{exportId}".sub("{" + "accountId" + "}", CGI.escape(account_id.to_s)).sub("{" + "exportId" + "}", CGI.escape(export_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params["Accept"] = @api_client.select_header_accept(["application/json"]) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || "ExportResult" + + # auth_names + auth_names = opts[:debug_auth_names] || ["fc"] + + new_options = opts.merge( + operation: :"DefaultApi.get_an_export", + header_params: header_params, + query_params: query_params, + form_params: form_params, + body: post_body, + auth_names: auth_names, + return_type: return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#get_an_export\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + [data, status_code, headers] + end + # Get an Incoming Number # @param phone_number_id [String] String that uniquely identifies this phone number resource. # @param [Hash] opts the optional parameters @@ -2341,6 +2587,8 @@ def list_call_recordings_with_http_info(call_id, opts = {}) # @option opts [String] :end_time Only show Calls that ended at or before this time, given as YYYY-MM- DD hh:mm:ss. # @option opts [String] :parent_call_id Only show Calls spawned by the call with this ID. # @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. # @return [CallList] def list_calls(opts = {}) data, _status_code, _headers = list_calls_with_http_info(opts) @@ -2357,6 +2605,8 @@ def list_calls(opts = {}) # @option opts [String] :end_time Only show Calls that ended at or before this time, given as YYYY-MM- DD hh:mm:ss. # @option opts [String] :parent_call_id Only show Calls spawned by the call with this ID. # @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. # @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 @@ -2379,6 +2629,8 @@ def list_calls_with_http_info(opts = {}) query_params[:endTime] = opts[:end_time] if !opts[:end_time].nil? query_params[:parentCallId] = opts[:parent_call_id] if !opts[:parent_call_id].nil? 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? # header parameters header_params = opts[:header_params] || {} @@ -2549,6 +2801,67 @@ def list_conferences_with_http_info(opts = {}) [data, status_code, headers] end + # List Exports + # @param [Hash] opts the optional parameters + # @option opts [ExportStatus] :status Status of export + # @option opts [String] :cursor Used to reference pages of a list of exports + # @return [ExportList] + def list_exports(opts = {}) + data, _status_code, _headers = list_exports_with_http_info(opts) + data + end + + # List Exports + # @param [Hash] opts the optional parameters + # @option opts [ExportStatus] :status Status of export + # @option opts [String] :cursor Used to reference pages of a list of exports + # @return [Array<(ExportList, Integer, Hash)>] ExportList data, response status code and response headers + def list_exports_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug "Calling API: DefaultApi.list_exports ..." + end + # resource path + local_var_path = "/Accounts/{accountId}/Exports".sub("{" + "accountId" + "}", CGI.escape(account_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:status] = opts[:status] if !opts[:status].nil? + query_params[:cursor] = opts[:cursor] if !opts[:cursor].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params["Accept"] = @api_client.select_header_accept(["application/json"]) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || "ExportList" + + # auth_names + auth_names = opts[:debug_auth_names] || ["fc"] + + new_options = opts.merge( + operation: :"DefaultApi.list_exports", + header_params: header_params, + query_params: query_params, + form_params: form_params, + body: post_body, + auth_names: auth_names, + return_type: return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#list_exports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + [data, status_code, headers] + end + # List Incoming Numbers # @param [Hash] opts the optional parameters # @option opts [String] :phone_number Only show incoming phone number resources that match this PCRE-compatible regular expression. diff --git a/lib/freeclimb/models/call_result.rb b/lib/freeclimb/models/call_result.rb index 101f0d1..be21684 100644 --- a/lib/freeclimb/models/call_result.rb +++ b/lib/freeclimb/models/call_result.rb @@ -43,7 +43,7 @@ class CallResult # If the Call was inbound, this is the ID of the IncomingPhoneNumber that received the Call (DNIS). If the Call was outbound, this is the ID of the phone number from which the Call was placed (ANI). attr_accessor :phone_number_id - attr_accessor :call_status + attr_accessor :status # Start time of the Call (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call has not yet been dialed. attr_accessor :start_time @@ -105,7 +105,7 @@ def self.attribute_map from: :from, to: :to, phone_number_id: :phoneNumberId, - call_status: :callStatus, + status: :status, start_time: :startTime, connect_time: :connectTime, end_time: :endTime, @@ -136,7 +136,7 @@ def self.openapi_types from: :String, to: :String, phone_number_id: :String, - call_status: :CallStatus, + status: :CallStatus, start_time: :String, connect_time: :String, end_time: :String, @@ -158,7 +158,7 @@ def self.openapi_nullable :from, :to, :phone_number_id, - :call_status, + :status, :start_time, :connect_time, :end_time, @@ -233,8 +233,8 @@ def initialize(attributes = {}) self.phone_number_id = attributes[:phone_number_id] end - if attributes.key?(:call_status) - self.call_status = attributes[:call_status] + if attributes.key?(:status) + self.status = attributes[:status] end if attributes.key?(:start_time) @@ -305,7 +305,7 @@ def ==(other) from == other.from && to == other.to && phone_number_id == other.phone_number_id && - call_status == other.call_status && + status == other.status && start_time == other.start_time && connect_time == other.connect_time && end_time == other.end_time && @@ -326,7 +326,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, call_status, start_time, connect_time, end_time, duration, connect_duration, direction, answered_by, subresource_uris, application_id].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 end # Builds the object from hash diff --git a/lib/freeclimb/models/create_conference.rb b/lib/freeclimb/models/create_conference.rb index 20fbb87..29f269e 100644 --- a/lib/freeclimb/models/create_conference.rb +++ b/lib/freeclimb/models/create_conference.rb @@ -31,6 +31,9 @@ class CreateConference < PerclCommand # If specified, this URL provides the custom hold music for the Conference when it is in the populated state. This attribute is always fetched using HTTP GET and is fetched just once – when the Conference is created. The URL must be an audio file that is reachable and readable by FreeClimb. attr_accessor :wait_url + # ID of the Call that created this leg (child call). + attr_accessor :parent_call_id + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -61,7 +64,8 @@ def self.attribute_map play_beep: :playBeep, record: :record, status_callback_url: :statusCallbackUrl, - wait_url: :waitUrl + wait_url: :waitUrl, + parent_call_id: :parentCallId } end @@ -74,11 +78,12 @@ def self.acceptable_attributes def self.openapi_types { action_url: :String, - _alias: :Boolean, + _alias: :String, play_beep: :PlayBeep, record: :Boolean, status_callback_url: :String, - wait_url: :String + wait_url: :String, + parent_call_id: :String } end @@ -137,6 +142,10 @@ def initialize(attributes = {}) if attributes.key?(:wait_url) self.wait_url = attributes[:wait_url] end + + if attributes.key?(:parent_call_id) + self.parent_call_id = attributes[:parent_call_id] + end self.command = "CreateConference" end @@ -171,7 +180,8 @@ def ==(other) play_beep == other.play_beep && record == other.record && status_callback_url == other.status_callback_url && - wait_url == other.wait_url && super + wait_url == other.wait_url && + parent_call_id == other.parent_call_id && super end # @see the `==` method @@ -183,7 +193,7 @@ def eql?(other) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [action_url, _alias, play_beep, record, status_callback_url, wait_url].hash + [action_url, _alias, play_beep, record, status_callback_url, wait_url, parent_call_id].hash end # Builds the object from hash diff --git a/lib/freeclimb/models/export_list.rb b/lib/freeclimb/models/export_list.rb new file mode 100644 index 0000000..0e6b909 --- /dev/null +++ b/lib/freeclimb/models/export_list.rb @@ -0,0 +1,304 @@ +# #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 + class ExportList + # Total amount of requested resource. + attr_accessor :total + + # Resource index at start of current page + attr_accessor :start + + # Resource index at end of current page + attr_accessor :_end + + # Current page + attr_accessor :page + + # Total number of pages + attr_accessor :num_pages + + # Number of items per page + attr_accessor :page_size + + # Uri to retrieve the next page of items + attr_accessor :next_page_uri + + attr_accessor :exports + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + total: :total, + start: :start, + _end: :end, + page: :page, + num_pages: :numPages, + page_size: :pageSize, + next_page_uri: :nextPageUri, + exports: :exports + } + 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 + { + total: :Integer, + start: :Integer, + _end: :Integer, + page: :Integer, + num_pages: :Integer, + page_size: :Integer, + next_page_uri: :String, + exports: :"Array" + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :total, + :start, + :_end, + :page, + :num_pages, + :page_size, + :next_page_uri, + :exports + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :PaginationModel + ] + 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::ExportList` 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::ExportList`. 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?(:total) + self.total = attributes[:total] + end + + if attributes.key?(:start) + self.start = attributes[:start] + end + + if attributes.key?(:_end) + self._end = attributes[:_end] + end + + if attributes.key?(:page) + self.page = attributes[:page] + end + + if attributes.key?(:num_pages) + self.num_pages = attributes[:num_pages] + end + + if attributes.key?(:page_size) + self.page_size = attributes[:page_size] + end + + if attributes.key?(:next_page_uri) + self.next_page_uri = attributes[:next_page_uri] + end + + if attributes.key?(:exports) + if (value = attributes[:exports]).is_a?(Array) + self.exports = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + [] + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + if @total.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 && + total == other.total && + start == other.start && + _end == other._end && + page == other.page && + num_pages == other.num_pages && + page_size == other.page_size && + next_page_uri == other.next_page_uri && + exports == other.exports + 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 + [total, start, _end, page, num_pages, page_size, next_page_uri, exports].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/export_output_type.rb b/lib/freeclimb/models/export_output_type.rb new file mode 100644 index 0000000..d8abd54 --- /dev/null +++ b/lib/freeclimb/models/export_output_type.rb @@ -0,0 +1,34 @@ +# #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 + class ExportOutputType + CSV = "csv".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = ExportOutputType.constants.select { |c| ExportOutputType.const_get(c) == value } + raise "Invalid ENUM value #{value} for class #ExportOutputType" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/models/export_request.rb b/lib/freeclimb/models/export_request.rb new file mode 100644 index 0000000..ec11e91 --- /dev/null +++ b/lib/freeclimb/models/export_request.rb @@ -0,0 +1,276 @@ +# #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 + class ExportRequest + attr_accessor :resource_type + + attr_accessor :format + + attr_accessor :output + + attr_accessor :query + + 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 + { + resource_type: :resourceType, + format: :format, + output: :output, + query: :query + } + 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 + { + resource_type: :ExportResourceType, + format: :"Array", + output: :ExportRequestOutput, + query: :Object + } + 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::ExportRequest` 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::ExportRequest`. 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?(:resource_type) + self.resource_type = attributes[:resource_type] + end + + if attributes.key?(:format) + if (value = attributes[:format]).is_a?(Array) + self.format = value + end + end + + if attributes.key?(:output) + self.output = attributes[:output] + end + + if attributes.key?(:query) + self.query = attributes[:query] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = [] + if @resource_type.nil? + invalid_properties.push('invalid value for "resource_type", resource_type cannot be nil.') + end + + if @output.nil? + invalid_properties.push('invalid value for "output", output 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 @resource_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 && + resource_type == other.resource_type && + format == other.format && + output == other.output && + query == other.query + 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 + [resource_type, format, output, query].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/export_request_output.rb b/lib/freeclimb/models/export_request_output.rb new file mode 100644 index 0000000..8a65e83 --- /dev/null +++ b/lib/freeclimb/models/export_request_output.rb @@ -0,0 +1,243 @@ +# #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 + class ExportRequestOutput + attr_accessor :type + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + type: :type + } + 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 + { + type: :ExportOutputType + } + 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::ExportRequestOutput` 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::ExportRequestOutput`. 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?(:type) + self.type = attributes[:type] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = [] + if @type.nil? + invalid_properties.push('invalid value for "type", type 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 @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 && + type == other.type + 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 + [type].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/export_resource_type.rb b/lib/freeclimb/models/export_resource_type.rb new file mode 100644 index 0000000..6df39ef --- /dev/null +++ b/lib/freeclimb/models/export_resource_type.rb @@ -0,0 +1,35 @@ +# #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 + class ExportResourceType + MESSAGES = "Messages".freeze + CALLS = "Calls".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = ExportResourceType.constants.select { |c| ExportResourceType.const_get(c) == value } + raise "Invalid ENUM value #{value} for class #ExportResourceType" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/models/export_result.rb b/lib/freeclimb/models/export_result.rb new file mode 100644 index 0000000..fe25091 --- /dev/null +++ b/lib/freeclimb/models/export_result.rb @@ -0,0 +1,405 @@ +# #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 + class ExportResult + # String that uniquely identifies this account resource. + attr_accessor :account_id + + attr_accessor :uri + + attr_accessor :date_created + + attr_accessor :date_updated + + attr_accessor :revision + + # String that uniquely identifies this export resource + attr_accessor :export_id + + attr_accessor :status + + attr_accessor :size + + attr_accessor :resource_type + + # Query params used to filter exported documents + attr_accessor :query + + # Desired fields of exported documents + attr_accessor :format + + attr_accessor :output + + 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 + { + account_id: :accountId, + uri: :uri, + date_created: :dateCreated, + date_updated: :dateUpdated, + revision: :revision, + export_id: :exportId, + status: :status, + size: :size, + resource_type: :resourceType, + query: :query, + format: :format, + output: :output + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + account_id: :String, + uri: :String, + date_created: :String, + date_updated: :String, + revision: :Integer, + export_id: :String, + status: :ExportStatus, + size: :Integer, + resource_type: :ExportResourceType, + query: :Object, + format: :"Array", + output: :ExportResultOutput + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :account_id, + :export_id + ]) + 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::ExportResult` 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::ExportResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:account_id) + self.account_id = attributes[:account_id] + end + + if attributes.key?(:uri) + self.uri = attributes[:uri] + end + + if attributes.key?(:date_created) + self.date_created = attributes[:date_created] + end + + if attributes.key?(:date_updated) + self.date_updated = attributes[:date_updated] + end + + if attributes.key?(:revision) + self.revision = attributes[:revision] + end + + if attributes.key?(:export_id) + self.export_id = attributes[:export_id] + end + + if attributes.key?(:status) + self.status = attributes[:status] + end + + if attributes.key?(:size) + self.size = attributes[:size] + end + + if attributes.key?(:resource_type) + self.resource_type = attributes[:resource_type] + end + + if attributes.key?(:query) + self.query = attributes[:query] + end + + if attributes.key?(:format) + if (value = attributes[:format]).is_a?(Array) + self.format = value + end + end + + if attributes.key?(:output) + self.output = attributes[:output] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = [] + if @uri.nil? + invalid_properties.push('invalid value for "uri", uri cannot be nil.') + end + + if @date_created.nil? + invalid_properties.push('invalid value for "date_created", date_created cannot be nil.') + end + + if @date_updated.nil? + invalid_properties.push('invalid value for "date_updated", date_updated cannot be nil.') + end + + if @revision.nil? + invalid_properties.push('invalid value for "revision", revision cannot be nil.') + end + + if @revision < 0 + invalid_properties.push('invalid value for "revision", must be greater than or equal to 0.') + end + + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + if @size.nil? + invalid_properties.push('invalid value for "size", size cannot be nil.') + end + + if @resource_type.nil? + invalid_properties.push('invalid value for "resource_type", resource_type cannot be nil.') + end + + if @query.nil? + invalid_properties.push('invalid value for "query", query cannot be nil.') + end + + if @format.nil? + invalid_properties.push('invalid value for "format", format cannot be nil.') + end + + if @output.nil? + invalid_properties.push('invalid value for "output", output 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 @account_id.nil? + false + else + list_invalid_properties.length == 0 + end + end + + # Custom attribute writer method with validation + # @param [Object] revision Value to be assigned + def revision=(revision) + if revision.nil? + fail ArgumentError, "revision cannot be nil" + end + + if revision < 0 + fail ArgumentError, 'invalid value for "revision", must be greater than or equal to 0.' + end + + @revision = revision + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(other) + return true if equal?(other) + self.class == other.class && + account_id == other.account_id && + uri == other.uri && + date_created == other.date_created && + date_updated == other.date_updated && + revision == other.revision && + export_id == other.export_id && + status == other.status && + size == other.size && + resource_type == other.resource_type && + query == other.query && + format == other.format && + output == other.output + 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 + [account_id, uri, date_created, date_updated, revision, export_id, status, size, resource_type, query, format, output].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/export_result_output.rb b/lib/freeclimb/models/export_result_output.rb new file mode 100644 index 0000000..95dac77 --- /dev/null +++ b/lib/freeclimb/models/export_result_output.rb @@ -0,0 +1,243 @@ +# #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 + class ExportResultOutput + attr_accessor :type + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + type: :type + } + 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 + { + type: :ExportOutputType + } + 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::ExportResultOutput` 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::ExportResultOutput`. 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?(:type) + self.type = attributes[:type] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = [] + if @type.nil? + invalid_properties.push('invalid value for "type", type 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 @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 && + type == other.type + 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 + [type].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/export_status.rb b/lib/freeclimb/models/export_status.rb new file mode 100644 index 0000000..b930b3d --- /dev/null +++ b/lib/freeclimb/models/export_status.rb @@ -0,0 +1,39 @@ +# #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 + class ExportStatus + INTAKING = "intaking".freeze + QUEUED = "queued".freeze + IN_PROGRESS = "inProgress".freeze + COMPLETED = "completed".freeze + FAILED = "failed".freeze + DELETED = "deleted".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = ExportStatus.constants.select { |c| ExportStatus.const_get(c) == value } + raise "Invalid ENUM value #{value} for class #ExportStatus" if constantValues.empty? + value + end + end +end diff --git a/lib/freeclimb/version.rb b/lib/freeclimb/version.rb index 5b36a83..61cba51 100644 --- a/lib/freeclimb/version.rb +++ b/lib/freeclimb/version.rb @@ -9,5 +9,5 @@ # module Freeclimb - VERSION = "5.2.0" + VERSION = "5.3.0" end diff --git a/openapi.json b/openapi.json index e8f5da9..7561d69 100644 --- a/openapi.json +++ b/openapi.json @@ -1968,7 +1968,7 @@ }, "alias": { "description": "Descriptive name for the Conference. ", - "type": "boolean" + "type": "string" }, "playBeep": { "$ref": "#/components/schemas/PlayBeep" @@ -1986,6 +1986,10 @@ "description": "If specified, this URL provides the custom hold music for the Conference when it is in the populated state. This attribute is always fetched using HTTP GET and is fetched just once – when the Conference is created. The URL must be an audio file that is reachable and readable by FreeClimb.", "format": "uri", "type": "string" + }, + "parentCallId": { + "description": "ID of the Call that created this leg (child call).", + "type": "string" } } } @@ -3113,7 +3117,7 @@ "description": "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).", "nullable": true }, - "callStatus": { + "status": { "$ref": "#/components/schemas/CallStatus" }, "startTime": { @@ -4830,6 +4834,187 @@ "minimum": 1 } } + }, + "ExportStatus": { + "type": "string", + "description": "platform export status", + "enum": [ + "intaking", + "queued", + "inProgress", + "completed", + "failed", + "deleted" + ] + }, + "ExportResourceType": { + "type": "string", + "description": "platform resource type", + "enum": [ + "Messages", + "Calls" + ] + }, + "ExportOutputType": { + "type": "string", + "description": "output type of the export", + "enum": [ + "csv" + ] + }, + "ExportRequestOutput": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/ExportOutputType" + } + } + }, + "ExportResultOutput": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/ExportOutputType" + } + } + }, + "ExportResult": { + "type": "object", + "required": [ + "accountId", + "uri", + "dateCreated", + "dateUpdated", + "revision", + "exportId", + "status", + "size", + "resourceType", + "query", + "format", + "output" + ], + "properties": { + "accountId": { + "type": "string", + "description": "String that uniquely identifies this account resource.", + "nullable": true + }, + "uri": { + "type": "string", + "format": "uri-reference" + }, + "dateCreated": { + "type": "string" + }, + "dateUpdated": { + "type": "string" + }, + "revision": { + "type": "integer", + "minimum": 0 + }, + "exportId": { + "type": "string", + "description": "String that uniquely identifies this export resource", + "nullable": true + }, + "status": { + "$ref": "#/components/schemas/ExportStatus" + }, + "size": { + "type": "integer" + }, + "resourceType": { + "$ref": "#/components/schemas/ExportResourceType" + }, + "query": { + "description": "Query params used to filter exported documents", + "type": "object" + }, + "format": { + "description": "Desired fields of exported documents", + "type": "array", + "items": { + "type": "string" + } + }, + "output": { + "$ref": "#/components/schemas/ExportResultOutput" + } + }, + "example": { + "accountId": "AC3ff5d5aed7fde9e6659673d850cbd18ea8bfca78", + "uri": "/Accounts/AC3ff5d5aed7fde9e6659673d850cbd18ea8bfca78/Exports/EX4d7500862e3abf4b9f4da24d54f559d3024252f8", + "dateCreated": "Wed, 26 Jun 2024 15:45:06 UTC", + "dateUpdated": "Wed, 26 Jun 2024 15:45:06 UTC", + "revision": 1, + "exportId": "EX4d7500862e3abf4b9f4da24d54f559d3024252f8", + "status": "completed", + "size": 12893786, + "resourceType": "Messages", + "query": { + "direction": "inbound" + }, + "format": [ + "messageId", + "dateUpdated", + "segmentCount", + "status" + ], + "output": { + "type": "csv" + } + } + }, + "ExportList": { + "allOf": [ + { + "$ref": "#/components/schemas/PaginationModel" + }, + { + "type": "object", + "properties": { + "exports": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExportResult" + }, + "nullable": true + } + } + } + ] + }, + "ExportRequest": { + "type": "object", + "required": [ + "resourceType", + "output" + ], + "properties": { + "resourceType": { + "$ref": "#/components/schemas/ExportResourceType" + }, + "format": { + "type": "array", + "items": { + "type": "string" + } + }, + "output": { + "$ref": "#/components/schemas/ExportRequestOutput" + }, + "query": { + "type": "object" + } + } } } }, @@ -5654,6 +5839,24 @@ }, { "$ref": "#/components/parameters/AccountId" + }, + { + "name": "riskScoreMin", + "in": "query", + "description": "The minimum riskScore that should be included in the list.", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "name": "riskScoreMax", + "in": "query", + "description": "The maximum riskScore that should be included in the list.", + "required": false, + "schema": { + "type": "integer" + } } ], "deprecated": false, @@ -7331,6 +7534,171 @@ }, "deprecated": false } + }, + "/Accounts/{accountId}/Exports": { + "get": { + "tags": [], + "summary": "List Exports", + "operationId": "list-exports", + "responses": { + "200": { + "description": "Successful retrieved export list", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExportList" + } + } + } + } + }, + "parameters": [ + { + "$ref": "#/components/parameters/AccountId" + }, + { + "schema": { + "$ref": "#/components/schemas/ExportStatus" + }, + "in": "query", + "name": "status", + "description": "Status of export" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "cursor", + "description": "Used to reference pages of a list of exports" + } + ] + }, + "post": { + "summary": "Create an Export", + "operationId": "create-export", + "tags": [], + "requestBody": { + "description": "A JSON object containing export creation parameters", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExportRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Export successfully created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExportResult" + } + } + } + } + }, + "parameters": [ + { + "$ref": "#/components/parameters/AccountId" + } + ] + } + }, + "/Accounts/{accountId}/Exports/{exportId}": { + "get": { + "tags": [], + "summary": "Get an Export", + "operationId": "get-an-export", + "parameters": [ + { + "$ref": "#/components/parameters/AccountId" + }, + { + "name": "exportId", + "in": "path", + "description": "A string that uniquely identifies this export resource.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "deprecated": false, + "responses": { + "200": { + "description": "Export Details", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExportResult" + } + } + } + } + } + }, + "delete": { + "tags": [], + "summary": "Delete an Export", + "operationId": "delete-an-export", + "parameters": [ + { + "$ref": "#/components/parameters/AccountId" + }, + { + "name": "exportId", + "in": "path", + "description": "A string that uniquely identifies this export resource.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "deprecated": false, + "responses": { + "204": { + "description": "Successful Export deletion" + } + } + } + }, + "/Accounts/{accountId}/Exports/{exportId}/Download": { + "get": { + "tags": [], + "summary": "Download an Export", + "operationId": "download-an-export", + "parameters": [ + { + "$ref": "#/components/parameters/AccountId" + }, + { + "name": "exportId", + "in": "path", + "description": "A string that uniquely identifies this export resource.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "deprecated": false, + "responses": { + "200": { + "description": "Export Details", + "content": { + "text/csv": { + "schema": { + "type": "string" + } + } + } + } + } + } } }, "x-headers": [], diff --git a/spec/api/default_api_spec.rb b/spec/api/default_api_spec.rb index 51ddb88..48134d3 100644 --- a/spec/api/default_api_spec.rb +++ b/spec/api/default_api_spec.rb @@ -252,6 +252,12 @@ @knowledge_base_id_create_knowledge_base_completion_test_value = "knowledgeBaseId_example" @completion_request_create_knowledge_base_completion_test_value = Freeclimb::CompletionRequest.new({query: "query_example"}) + + @export_id_download_an_export_test_value = "download_exportId_example" + + @export_id_delete_an_export_test_value = "delete_exportId_example" + + @export_id_get_an_export_test_value = "get_exportId_example" end after do @@ -348,6 +354,27 @@ end end + # unit tests for create_export + # Create an Export + # @param [Hash] opts the optional parameters + # @option opts [ExportRequest] :export_request A JSON object containing export creation parameters + # @return [ExportResult] + describe "create_export test" do + it "should work" do + export_request = @export_request_create_export_test_value + + result = @api_instance.create_export( + { + export_request: export_request + } + ) + + expect(result).to be_a Freeclimb::ExportResult + + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for create_knowledge_base_completion # Query the knowledge base # @param knowledge_base_id A string that uniquely identifies the KnowledgeBase resource. @@ -410,6 +437,25 @@ end end + # unit tests for delete_an_export + # Delete an Export + # @param export_id A string that uniquely identifies this export resource. + # @param [Hash] opts the optional parameters + # @return [nil] + describe "delete_an_export test" do + it "should work" do + export_id = @export_id_delete_an_export_test_value + + result = @api_instance.delete_an_export( + export_id, + {} + ) + + expect(result).to be_nil + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for delete_an_incoming_number # Delete an Incoming Number # @param phone_number_id String that uniquely identifies this phone number resource. @@ -491,6 +537,25 @@ end end + # unit tests for download_an_export + # Download an Export + # @param export_id A string that uniquely identifies this export resource. + # @param [Hash] opts the optional parameters + # @return [String] + describe "download_an_export test" do + it "should work" do + export_id = @export_id_download_an_export_test_value + + result = @api_instance.download_an_export( + export_id, + {} + ) + expect(result).to be_a String + + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for filter_logs # Filter Logs # @param filter_logs_request Filter logs request paramters @@ -671,6 +736,26 @@ end end + # unit tests for get_an_export + # Get an Export + # @param export_id A string that uniquely identifies this export resource. + # @param [Hash] opts the optional parameters + # @return [ExportResult] + describe "get_an_export test" do + it "should work" do + export_id = @export_id_get_an_export_test_value + + result = @api_instance.get_an_export( + export_id, + {} + ) + + expect(result).to be_a Freeclimb::ExportResult + + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for get_an_incoming_number # Get an Incoming Number # @param phone_number_id String that uniquely identifies this phone number resource. @@ -1037,6 +1122,8 @@ # @option opts [String] :end_time Only show Calls that ended at or before this time, given as YYYY-MM- DD hh:mm:ss. # @option opts [String] :parent_call_id Only show Calls spawned by the call with this ID. # @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. # @return [CallList] describe "list_calls test" do it "should work" do @@ -1048,10 +1135,12 @@ end_time = @end_time_list_calls_test_value parent_call_id = @parent_call_id_list_calls_test_value 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 result = @api_instance.list_calls( { - active: active, to: to, from: from, status: status, start_time: start_time, end_time: end_time, parent_call_id: parent_call_id, application_id: application_id + active: active, to: to, from: from, status: status, start_time: start_time, end_time: end_time, parent_call_id: parent_call_id, application_id: application_id, risk_score_min: risk_score_min, risk_score_max: risk_score_max } ) @@ -1114,6 +1203,29 @@ end end + # unit tests for list_exports + # List Exports + # @param [Hash] opts the optional parameters + # @option opts [ExportStatus] :status Status of export + # @option opts [String] :cursor Used to reference pages of a list of exports + # @return [ExportList] + describe "list_exports test" do + it "should work" do + status = @status_list_exports_test_value + cursor = @cursor_list_exports_test_value + + result = @api_instance.list_exports( + { + status: status, cursor: cursor + } + ) + + expect(result).to be_a Freeclimb::ExportList + + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for list_incoming_numbers # List Incoming Numbers # @param [Hash] opts the optional parameters @@ -1782,6 +1894,8 @@ # @option opts [String] :end_time Only show Calls that ended at or before this time, given as YYYY-MM- DD hh:mm:ss. # @option opts [String] :parent_call_id Only show Calls spawned by the call with this ID. # @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. # @return [CallList] describe "list_calls_get_next_page test" do it "should work" do @@ -1793,10 +1907,12 @@ end_time = @end_time_list_calls_test_value parent_call_id = @parent_call_id_list_calls_test_value 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 result = @api_instance.list_calls( { - active: active, to: to, from: from, status: status, start_time: start_time, end_time: end_time, parent_call_id: parent_call_id, application_id: application_id + active: active, to: to, from: from, status: status, start_time: start_time, end_time: end_time, parent_call_id: parent_call_id, application_id: application_id, risk_score_min: risk_score_min, risk_score_max: risk_score_max } ) result.next_page_uri = "/Accounts/{accountId}/Calls?cursor=1" @@ -1859,6 +1975,29 @@ end end + # unit tests for get_next_page list_exports + # List Exports + # @param [Hash] opts the optional parameters + # @option opts [ExportStatus] :status Status of export + # @option opts [String] :cursor Used to reference pages of a list of exports + # @return [ExportList] + describe "list_exports_get_next_page test" do + it "should work" do + status = @status_list_exports_test_value + cursor = @cursor_list_exports_test_value + + result = @api_instance.list_exports( + { + status: status, cursor: cursor + } + ) + result.next_page_uri = "/Accounts/{accountId}/Exports?cursor=1" + next_page_result = @api_instance.get_next_page(result) + expect(next_page_result).to be_a Freeclimb::ExportList + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for get_next_page list_incoming_numbers # List Incoming Numbers # @param [Hash] opts the optional parameters diff --git a/spec/models/call_result_spec.rb b/spec/models/call_result_spec.rb index c6ac7fb..7e84aec 100644 --- a/spec/models/call_result_spec.rb +++ b/spec/models/call_result_spec.rb @@ -95,38 +95,38 @@ end end - describe 'test attribute "call_status"' do + describe 'test attribute "status"' do it "assigns value QUEUED" do - instance.call_status = Freeclimb::CallStatus::QUEUED - expect(instance.call_status).to eq(Freeclimb::CallStatus::QUEUED) + instance.status = Freeclimb::CallStatus::QUEUED + expect(instance.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) + instance.status = Freeclimb::CallStatus::RINGING + expect(instance.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) + instance.status = Freeclimb::CallStatus::IN_PROGRESS + expect(instance.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) + instance.status = Freeclimb::CallStatus::CANCELED + expect(instance.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) + instance.status = Freeclimb::CallStatus::COMPLETED + expect(instance.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) + instance.status = Freeclimb::CallStatus::FAILED + expect(instance.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) + instance.status = Freeclimb::CallStatus::BUSY + expect(instance.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) + instance.status = Freeclimb::CallStatus::NO_ANSWER + expect(instance.status).to eq(Freeclimb::CallStatus::NO_ANSWER) end end describe 'test attribute "start_time"' do @@ -231,7 +231,7 @@ phone_number_id: "TS", - call_status: Freeclimb::CallStatus::QUEUED, + status: Freeclimb::CallStatus::QUEUED, start_time: "TS", @@ -276,7 +276,7 @@ phone_number_id: "TS", - call_status: Freeclimb::CallStatus::QUEUED, + status: Freeclimb::CallStatus::QUEUED, start_time: "TS", @@ -323,7 +323,7 @@ phone_number_id: "TS", - call_status: Freeclimb::CallStatus::QUEUED, + status: Freeclimb::CallStatus::QUEUED, start_time: "TS", @@ -372,7 +372,7 @@ phone_number_id: "TS", - call_status: Freeclimb::CallStatus::QUEUED, + status: Freeclimb::CallStatus::QUEUED, start_time: "TS", @@ -427,7 +427,7 @@ phone_number_id: "TS", - call_status: Freeclimb::CallStatus::QUEUED, + status: Freeclimb::CallStatus::QUEUED, start_time: "TS", @@ -468,7 +468,7 @@ phone_number_id: "TS", - call_status: Freeclimb::CallStatus::QUEUED, + status: Freeclimb::CallStatus::QUEUED, start_time: "TS", @@ -513,7 +513,7 @@ phone_number_id: "TS", - call_status: Freeclimb::CallStatus::QUEUED, + status: Freeclimb::CallStatus::QUEUED, start_time: "TS", @@ -556,7 +556,7 @@ phone_number_id: "ST", - call_status: nil, + status: nil, start_time: "ST", @@ -603,7 +603,7 @@ phone_number_id: "TS", - call_status: Freeclimb::CallStatus::QUEUED, + status: Freeclimb::CallStatus::QUEUED, start_time: "TS", @@ -650,7 +650,7 @@ phone_number_id: "TS", - call_status: Freeclimb::CallStatus::QUEUED, + status: Freeclimb::CallStatus::QUEUED, start_time: "TS", @@ -691,7 +691,7 @@ phone_number_id: "TS", - call_status: Freeclimb::CallStatus::QUEUED, + status: Freeclimb::CallStatus::QUEUED, start_time: "TS", @@ -738,7 +738,7 @@ phone_number_id: "TS", - call_status: Freeclimb::CallStatus::QUEUED, + status: Freeclimb::CallStatus::QUEUED, start_time: "TS", @@ -850,7 +850,7 @@ phone_number_id: "TS", - call_status: Freeclimb::CallStatus::QUEUED, + status: Freeclimb::CallStatus::QUEUED, start_time: "TS", @@ -897,7 +897,7 @@ phone_number_id: "TS", - call_status: Freeclimb::CallStatus::QUEUED, + status: Freeclimb::CallStatus::QUEUED, start_time: "TS", @@ -943,7 +943,7 @@ phone_number_id: "TS", - call_status: Freeclimb::CallStatus::QUEUED, + status: Freeclimb::CallStatus::QUEUED, start_time: "TS", @@ -984,7 +984,7 @@ phone_number_id: "TS", - call_status: Freeclimb::CallStatus::QUEUED, + status: Freeclimb::CallStatus::QUEUED, start_time: "TS", @@ -1030,7 +1030,7 @@ phone_number_id: "TS", - call_status: Freeclimb::CallStatus::QUEUED, + status: Freeclimb::CallStatus::QUEUED, start_time: "TS", @@ -1078,8 +1078,8 @@ it "returns phone_number_id in the form of hash" do expect(instance._to_hash(instance.phone_number_id)).to eq(instance.phone_number_id) end - it "returns call_status in the form of hash" do - expect(instance._to_hash(instance.call_status)).to eq(instance.call_status) + it "returns status in the form of hash" do + expect(instance._to_hash(instance.status)).to eq(instance.status) end it "returns start_time in the form of hash" do expect(instance._to_hash(instance.start_time)).to eq(instance.start_time) diff --git a/spec/models/create_conference_spec.rb b/spec/models/create_conference_spec.rb index d532abc..942613e 100644 --- a/spec/models/create_conference_spec.rb +++ b/spec/models/create_conference_spec.rb @@ -34,8 +34,8 @@ describe 'test attribute "_alias"' do it "should work" do - instance._alias = false - expect(instance._alias).to eq(false) + instance._alias = "TEST_STRING" + expect(instance._alias).to eq("TEST_STRING") end end @@ -78,13 +78,20 @@ end end + describe 'test attribute "parent_call_id"' do + it "should work" do + instance.parent_call_id = "TEST_STRING" + expect(instance.parent_call_id).to eq("TEST_STRING") + end + end + describe 'test method "initialize"' do it "properly initializes with values" do expect { Freeclimb::CreateConference.new( action_url: "TS", - _alias: true, + _alias: "TS", play_beep: Freeclimb::PlayBeep::ALWAYS, @@ -92,7 +99,9 @@ status_callback_url: "TS", - wait_url: "TS" + wait_url: "TS", + + parent_call_id: "TS" ) }.not_to raise_error end @@ -101,7 +110,7 @@ Freeclimb::CreateConference.new( action_url: "TS", - _alias: true, + _alias: "TS", play_beep: Freeclimb::PlayBeep::ALWAYS, @@ -111,6 +120,8 @@ wait_url: "TS", + parent_call_id: "TS", + invalid_attribute: true ) }.to raise_error(ArgumentError) @@ -120,7 +131,7 @@ Freeclimb::CreateConference.new( action_url: "TS", - _alias: true, + _alias: "TS", play_beep: Freeclimb::PlayBeep::ALWAYS, @@ -130,6 +141,8 @@ wait_url: "TS", + parent_call_id: "TS", + invalid_attribute: true ) }.to raise_error(ArgumentError) @@ -141,7 +154,7 @@ instance = Freeclimb::CreateConference.new( action_url: "TS", - _alias: true, + _alias: "TS", play_beep: Freeclimb::PlayBeep::ALWAYS, @@ -149,7 +162,9 @@ status_callback_url: "TS", - wait_url: "TS" + wait_url: "TS", + + parent_call_id: "TS" ) expect(instance.valid?).to eq(true) end @@ -166,7 +181,7 @@ instance_1 = Freeclimb::CreateConference.new( action_url: "TS", - _alias: true, + _alias: "TS", play_beep: Freeclimb::PlayBeep::ALWAYS, @@ -174,12 +189,14 @@ status_callback_url: "TS", - wait_url: "TS" + wait_url: "TS", + + parent_call_id: "TS" ) instance_2 = Freeclimb::CreateConference.new( action_url: "TS", - _alias: true, + _alias: "TS", play_beep: Freeclimb::PlayBeep::ALWAYS, @@ -187,7 +204,9 @@ status_callback_url: "TS", - wait_url: "TS" + wait_url: "TS", + + parent_call_id: "TS" ) expect(instance_1.eql?(instance_2)).to eq(true) end @@ -196,7 +215,7 @@ instance_1 = Freeclimb::CreateConference.new( action_url: "TS", - _alias: true, + _alias: "TS", play_beep: Freeclimb::PlayBeep::ALWAYS, @@ -204,12 +223,14 @@ status_callback_url: "TS", - wait_url: "TS" + wait_url: "TS", + + parent_call_id: "TS" ) instance_2 = Freeclimb::CreateConference.new( action_url: "ST", - _alias: false, + _alias: "ST", play_beep: nil, @@ -217,7 +238,9 @@ status_callback_url: "ST", - wait_url: "ST" + wait_url: "ST", + + parent_call_id: "ST" ) expect(instance_1.eql?(instance_2)).to eq(false) end @@ -228,7 +251,7 @@ instance = Freeclimb::CreateConference.new( action_url: "TS", - _alias: true, + _alias: "TS", play_beep: Freeclimb::PlayBeep::ALWAYS, @@ -236,7 +259,9 @@ status_callback_url: "TS", - wait_url: "TS" + wait_url: "TS", + + parent_call_id: "TS" ) expect(instance.hash).to be_a_kind_of(Integer) end @@ -247,7 +272,7 @@ instance_1 = Freeclimb::CreateConference.new( action_url: "TS", - _alias: true, + _alias: "TS", play_beep: Freeclimb::PlayBeep::ALWAYS, @@ -255,12 +280,14 @@ status_callback_url: "TS", - wait_url: "TS" + wait_url: "TS", + + parent_call_id: "TS" ) instance_2 = Freeclimb::CreateConference.new( action_url: "TS", - _alias: true, + _alias: "TS", play_beep: Freeclimb::PlayBeep::ALWAYS, @@ -268,7 +295,9 @@ status_callback_url: "TS", - wait_url: "TS" + wait_url: "TS", + + parent_call_id: "TS" ) expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) @@ -279,7 +308,7 @@ instance = Freeclimb::CreateConference.new( action_url: "TS", - _alias: true, + _alias: "TS", play_beep: Freeclimb::PlayBeep::ALWAYS, @@ -287,14 +316,16 @@ status_callback_url: "TS", - wait_url: "TS" + wait_url: "TS", + + parent_call_id: "TS" ) 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 _alias" do - expect(instance._deserialize("Boolean", instance._alias)).to be_a_kind_of(TrueClass) + expect(instance._deserialize("String", instance._alias)).to be_a_kind_of(String) end it "deserializes the data of record" do @@ -307,6 +338,10 @@ it "deserializes the data of wait_url" do expect(instance._deserialize("String", instance.wait_url)).to be_a_kind_of(String) end + + it "deserializes the data of parent_call_id" do + expect(instance._deserialize("String", instance.parent_call_id)).to be_a_kind_of(String) + end end describe 'test method "to_s"' do @@ -314,7 +349,7 @@ instance = Freeclimb::CreateConference.new( action_url: "TS", - _alias: true, + _alias: "TS", play_beep: Freeclimb::PlayBeep::ALWAYS, @@ -322,7 +357,9 @@ status_callback_url: "TS", - wait_url: "TS" + wait_url: "TS", + + parent_call_id: "TS" ) expect(instance.to_s).to eq(instance.to_hash.to_s) end @@ -333,7 +370,7 @@ instance = Freeclimb::CreateConference.new( action_url: "TS", - _alias: true, + _alias: "TS", play_beep: Freeclimb::PlayBeep::ALWAYS, @@ -341,7 +378,9 @@ status_callback_url: "TS", - wait_url: "TS" + wait_url: "TS", + + parent_call_id: "TS" ) expect(instance.to_hash).to be_a_kind_of(Hash) end @@ -349,7 +388,7 @@ instance_1 = Freeclimb::CreateConference.new( action_url: "TS", - _alias: true, + _alias: "TS", play_beep: Freeclimb::PlayBeep::ALWAYS, @@ -357,12 +396,14 @@ status_callback_url: "TS", - wait_url: "TS" + wait_url: "TS", + + parent_call_id: "TS" ) instance_2 = Freeclimb::CreateConference.new( action_url: "TS", - _alias: true, + _alias: "TS", play_beep: Freeclimb::PlayBeep::ALWAYS, @@ -370,7 +411,9 @@ status_callback_url: "TS", - wait_url: "TS" + wait_url: "TS", + + parent_call_id: "TS" ) expect(instance_1.to_hash).to eq(instance_2.to_hash) end @@ -380,7 +423,7 @@ instance = Freeclimb::CreateConference.new( action_url: "TS", - _alias: true, + _alias: "TS", play_beep: Freeclimb::PlayBeep::ALWAYS, @@ -388,7 +431,9 @@ status_callback_url: "TS", - wait_url: "TS" + wait_url: "TS", + + parent_call_id: "TS" ) it "returns action_url in the form of hash" do expect(instance._to_hash(instance.action_url)).to eq(instance.action_url) @@ -408,5 +453,8 @@ it "returns wait_url in the form of hash" do expect(instance._to_hash(instance.wait_url)).to eq(instance.wait_url) end + it "returns parent_call_id in the form of hash" do + expect(instance._to_hash(instance.parent_call_id)).to eq(instance.parent_call_id) + end end end diff --git a/spec/models/export_list_spec.rb b/spec/models/export_list_spec.rb new file mode 100644 index 0000000..4af4e7f --- /dev/null +++ b/spec/models/export_list_spec.rb @@ -0,0 +1,502 @@ +# #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::ExportList +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::ExportList do + let(:instance) { Freeclimb::ExportList.new } + + describe "test an instance of ExportList" do + it "should create an instance of ExportList" do + expect(instance).to be_instance_of(Freeclimb::ExportList) + end + end + + describe 'test attribute "total"' do + it "should work" do + instance.total = 1 + expect(instance.total).to eq(1) + end + end + + describe 'test attribute "start"' do + it "should work" do + instance.start = 1 + expect(instance.start).to eq(1) + end + end + + describe 'test attribute "_end"' do + it "should work" do + instance._end = 1 + expect(instance._end).to eq(1) + end + end + + describe 'test attribute "page"' do + it "should work" do + instance.page = 1 + expect(instance.page).to eq(1) + end + end + + describe 'test attribute "num_pages"' do + it "should work" do + instance.num_pages = 1 + expect(instance.num_pages).to eq(1) + end + end + + describe 'test attribute "page_size"' do + it "should work" do + instance.page_size = 1 + expect(instance.page_size).to eq(1) + end + end + + describe 'test attribute "next_page_uri"' do + it "should work" do + instance.next_page_uri = "TEST_STRING" + expect(instance.next_page_uri).to eq("TEST_STRING") + end + end + + describe 'test attribute "exports"' do + it "should work" do + instance.exports = ["ELEMENT_1", "ELEMENT_2"] + expect(instance.exports).to eq(["ELEMENT_1", "ELEMENT_2"]) + end + end + + describe 'test method "initialize"' do + it "properly initializes with values" do + expect { + Freeclimb::ExportList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + exports: [] + ) + }.not_to raise_error + end + it "fails to initialize with input argument that is not a hash in Freeclimb::ExportList" do + expect { + Freeclimb::ExportList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + exports: [], + + invalid_attribute: true + ) + }.to raise_error(ArgumentError) + end + it "fails to initialize with invalid attribute" do + expect { + Freeclimb::ExportList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + exports: [], + + invalid_attribute: true + ) + }.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it "checks if properties are valid" do + instance = Freeclimb::ExportList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + exports: [] + ) + expect(instance.valid?).to eq(true) + end + + skip "checks if properties are invalid" do + instance = Freeclimb::ExportList.new + + expect(instance.valid?).to eq(false) + end + end + + describe 'test method "eql?"' do + it "checks if objects are equal" do + instance_1 = Freeclimb::ExportList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + exports: [] + ) + instance_2 = Freeclimb::ExportList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + exports: [] + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it "checks if objects are not equal" do + instance_1 = Freeclimb::ExportList.new( + total: 2, + + start: 2, + + _end: 2, + + page: 2, + + num_pages: 2, + + page_size: 2, + + next_page_uri: "TS", + + exports: [] + ) + instance_2 = Freeclimb::ExportList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "ST", + + exports: nil + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it "calculates hash code" do + instance = Freeclimb::ExportList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + exports: [] + ) + 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::ExportList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + exports: [] + ) + instance_2 = Freeclimb::ExportList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + exports: [] + ) + + 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::ExportList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + exports: [] + ) + it "deserializes the data of total" do + expect(instance._deserialize("Integer", instance.total)).to be_a_kind_of(Integer) + end + + it "deserializes the data of start" do + expect(instance._deserialize("Integer", instance.start)).to be_a_kind_of(Integer) + end + + it "deserializes the data of _end" do + expect(instance._deserialize("Integer", instance._end)).to be_a_kind_of(Integer) + end + + it "deserializes the data of page" do + expect(instance._deserialize("Integer", instance.page)).to be_a_kind_of(Integer) + end + + it "deserializes the data of num_pages" do + expect(instance._deserialize("Integer", instance.num_pages)).to be_a_kind_of(Integer) + end + + it "deserializes the data of page_size" do + expect(instance._deserialize("Integer", instance.page_size)).to be_a_kind_of(Integer) + end + + it "deserializes the data of next_page_uri" do + expect(instance._deserialize("String", instance.next_page_uri)).to be_a_kind_of(String) + end + + it "deserializes the data of exports" do + expect(instance._deserialize("Array", instance.exports)).to be_a_kind_of(Array) + end + end + + describe 'test method "to_s"' do + it "returns the string representation of the object" do + instance = Freeclimb::ExportList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + exports: [] + ) + 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::ExportList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + exports: [] + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it "creates equal hash for two equal objects" do + instance_1 = Freeclimb::ExportList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + exports: [] + ) + instance_2 = Freeclimb::ExportList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + exports: [] + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::ExportList.new( + total: 1, + + start: 1, + + _end: 1, + + page: 1, + + num_pages: 1, + + page_size: 1, + + next_page_uri: "TS", + + exports: [] + ) + it "returns total in the form of hash" do + expect(instance._to_hash(instance.total)).to eq(instance.total) + end + it "returns start in the form of hash" do + expect(instance._to_hash(instance.start)).to eq(instance.start) + end + it "returns _end in the form of hash" do + expect(instance._to_hash(instance._end)).to eq(instance._end) + end + it "returns page in the form of hash" do + expect(instance._to_hash(instance.page)).to eq(instance.page) + end + it "returns num_pages in the form of hash" do + expect(instance._to_hash(instance.num_pages)).to eq(instance.num_pages) + end + it "returns page_size in the form of hash" do + expect(instance._to_hash(instance.page_size)).to eq(instance.page_size) + end + it "returns next_page_uri in the form of hash" do + expect(instance._to_hash(instance.next_page_uri)).to eq(instance.next_page_uri) + end + it "returns exports in the form of hash" do + expect(instance._to_hash(instance.exports)).to eq(instance.exports) + end + end +end diff --git a/spec/models/export_output_type_spec.rb b/spec/models/export_output_type_spec.rb new file mode 100644 index 0000000..32d9af2 --- /dev/null +++ b/spec/models/export_output_type_spec.rb @@ -0,0 +1,43 @@ +# #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::ExportOutputType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::ExportOutputType do + let(:instance) { Freeclimb::ExportOutputType.new } + + describe "test an instance of ExportOutputType" do + it "should create an instance of ExportOutputType" do + expect(instance).to be_instance_of(Freeclimb::ExportOutputType) + end + end + + describe 'test attribute "CSV"' do + it "should work" do + expect { Freeclimb::ExportOutputType::CSV = "csv" }.not_to raise_error + end + it "should serialize to enum" do + expectedValue = Freeclimb::ExportOutputType::CSV + calculatedValue = Freeclimb::ExportOutputType.build_from_hash("csv") + expect(expectedValue).to eq(calculatedValue) + end + it "should deserialize to string" do + expectedValue = "csv" + calculatedValue = Freeclimb::ExportOutputType::CSV + expect(expectedValue).to eq(calculatedValue) + end + end +end diff --git a/spec/models/export_request_output_spec.rb b/spec/models/export_request_output_spec.rb new file mode 100644 index 0000000..f6d9d65 --- /dev/null +++ b/spec/models/export_request_output_spec.rb @@ -0,0 +1,162 @@ +# #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::ExportRequestOutput +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::ExportRequestOutput do + let(:instance) { Freeclimb::ExportRequestOutput.new } + + describe "test an instance of ExportRequestOutput" do + it "should create an instance of ExportRequestOutput" do + expect(instance).to be_instance_of(Freeclimb::ExportRequestOutput) + end + end + + describe 'test attribute "type"' do + it "assigns value CSV" do + instance.type = Freeclimb::ExportOutputType::CSV + expect(instance.type).to eq(Freeclimb::ExportOutputType::CSV) + end + end + describe 'test method "initialize"' do + it "properly initializes with values" do + expect { + Freeclimb::ExportRequestOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + }.not_to raise_error + end + it "fails to initialize with input argument that is not a hash in Freeclimb::ExportRequestOutput" do + expect { + Freeclimb::ExportRequestOutput.new( + type: Freeclimb::ExportOutputType::CSV, + + invalid_attribute: true + ) + }.to raise_error(ArgumentError) + end + it "fails to initialize with invalid attribute" do + expect { + Freeclimb::ExportRequestOutput.new( + type: Freeclimb::ExportOutputType::CSV, + + invalid_attribute: true + ) + }.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it "checks if properties are valid" do + instance = Freeclimb::ExportRequestOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + expect(instance.valid?).to eq(true) + end + + skip "checks if properties are invalid" do + instance = Freeclimb::ExportRequestOutput.new + + expect(instance.valid?).to eq(false) + end + end + + describe 'test method "eql?"' do + it "checks if objects are equal" do + instance_1 = Freeclimb::ExportRequestOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + instance_2 = Freeclimb::ExportRequestOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it "checks if objects are not equal" do + instance_1 = Freeclimb::ExportRequestOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + instance_2 = Freeclimb::ExportRequestOutput.new( + type: nil + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it "calculates hash code" do + instance = Freeclimb::ExportRequestOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + 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::ExportRequestOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + instance_2 = Freeclimb::ExportRequestOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + + 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 + Freeclimb::ExportRequestOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + end + + describe 'test method "to_s"' do + it "returns the string representation of the object" do + instance = Freeclimb::ExportRequestOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + 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::ExportRequestOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it "creates equal hash for two equal objects" do + instance_1 = Freeclimb::ExportRequestOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + instance_2 = Freeclimb::ExportRequestOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::ExportRequestOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + it "returns type in the form of hash" do + expect(instance._to_hash(instance.type)).to eq(instance.type) + end + end +end diff --git a/spec/models/export_request_spec.rb b/spec/models/export_request_spec.rb new file mode 100644 index 0000000..c94a08a --- /dev/null +++ b/spec/models/export_request_spec.rb @@ -0,0 +1,320 @@ +# #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::ExportRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::ExportRequest do + let(:instance) { Freeclimb::ExportRequest.new } + + describe "test an instance of ExportRequest" do + it "should create an instance of ExportRequest" do + expect(instance).to be_instance_of(Freeclimb::ExportRequest) + end + end + + describe 'test attribute "resource_type"' do + it "assigns value MESSAGES" do + instance.resource_type = Freeclimb::ExportResourceType::MESSAGES + expect(instance.resource_type).to eq(Freeclimb::ExportResourceType::MESSAGES) + end + it "assigns value CALLS" do + instance.resource_type = Freeclimb::ExportResourceType::CALLS + expect(instance.resource_type).to eq(Freeclimb::ExportResourceType::CALLS) + end + end + describe 'test attribute "format"' do + it "should work" do + instance.format = ["ELEMENT_1", "ELEMENT_2"] + expect(instance.format).to eq(["ELEMENT_1", "ELEMENT_2"]) + end + end + + describe 'test attribute "output"' do + it "should work" do + instance.output = ExportRequestOutput.new + expect(instance.output).to be_instance_of(ExportRequestOutput) + end + end + + describe 'test attribute "query"' do + it "should work" do + testObject = Object.new + instance.query = testObject + expect(instance.query).to eq(testObject) + + instance.query = Object.new + expect(instance.query).to be_instance_of(Object) + end + end + + describe 'test method "initialize"' do + it "properly initializes with values" do + expect { + Freeclimb::ExportRequest.new( + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [], + + output: ExportRequestOutput.new, + + query: Object.new + ) + }.not_to raise_error + end + it "fails to initialize with input argument that is not a hash in Freeclimb::ExportRequest" do + expect { + Freeclimb::ExportRequest.new( + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [], + + output: ExportRequestOutput.new, + + query: Object.new, + + invalid_attribute: true + ) + }.to raise_error(ArgumentError) + end + it "fails to initialize with invalid attribute" do + expect { + Freeclimb::ExportRequest.new( + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [], + + output: ExportRequestOutput.new, + + query: Object.new, + + invalid_attribute: true + ) + }.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it "checks if properties are valid" do + instance = Freeclimb::ExportRequest.new( + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [], + + output: ExportRequestOutput.new, + + query: Object.new + ) + expect(instance.valid?).to eq(true) + end + + skip "checks if properties are invalid" do + instance = Freeclimb::ExportRequest.new + + expect(instance.valid?).to eq(false) + end + end + + describe 'test method "eql?"' do + it "checks if objects are equal" do + obj_ExportRequestOutput = ExportRequestOutput.new + + obj_Object = Object.new + + instance_1 = Freeclimb::ExportRequest.new( + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [], + + output: obj_ExportRequestOutput, + + query: obj_Object + ) + instance_2 = Freeclimb::ExportRequest.new( + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [], + + output: obj_ExportRequestOutput, + + query: obj_Object + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it "checks if objects are not equal" do + instance_1 = Freeclimb::ExportRequest.new( + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [], + + output: ExportRequestOutput.new, + + query: Object.new, + + query: Object.new + ) + instance_2 = Freeclimb::ExportRequest.new( + resource_type: nil, + + format: nil, + + output: ExportRequestOutput.new, + + query: Object.new + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it "calculates hash code" do + instance = Freeclimb::ExportRequest.new( + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [], + + output: ExportRequestOutput.new, + + query: Object.new + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it "builds equivalent model from hash code" do + instance_1 = Freeclimb::ExportRequest.new( + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [], + + output: ExportRequestOutput.new, + + query: Object.new + ) + instance_2 = Freeclimb::ExportRequest.new( + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [], + + output: ExportRequestOutput.new, + + query: Object.new + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::ExportRequest.new( + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [], + + output: ExportRequestOutput.new, + + query: Object.new + ) + + it "deserializes the data of format" do + expect(instance._deserialize("Array", instance.format)).to be_a_kind_of(Array) + end + + it "deserializes the data of output" do + expect(instance._deserialize("Object", instance.output)).to be_a_kind_of(ExportRequestOutput) + end + + it "deserializes the data of query" do + expect(instance._deserialize("Object", instance.query)).to be_a_kind_of(Object) + end + end + + describe 'test method "to_s"' do + it "returns the string representation of the object" do + instance = Freeclimb::ExportRequest.new( + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [], + + output: ExportRequestOutput.new, + + query: Object.new + ) + 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::ExportRequest.new( + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [], + + output: ExportRequestOutput.new, + + query: Object.new + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it "creates equal hash for two equal objects" do + ExportRequestOutput.new + + obj = Object.new + + instance_1 = Freeclimb::ExportRequest.new( + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [], + + output: obj, + + query: obj + ) + instance_2 = Freeclimb::ExportRequest.new( + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [], + + output: obj, + + query: obj + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::ExportRequest.new( + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [] + ) + it "returns resource_type in the form of hash" do + expect(instance._to_hash(instance.resource_type)).to eq(instance.resource_type) + end + it "returns format in the form of hash" do + expect(instance._to_hash(instance.format)).to eq(instance.format) + end + it "returns output in the form of hash" do + expect(instance._to_hash(instance.output)).to eq(instance.output) + end + it "returns query in the form of hash" do + expect(instance._to_hash(instance.query)).to eq(instance.query) + end + end +end diff --git a/spec/models/export_resource_type_spec.rb b/spec/models/export_resource_type_spec.rb new file mode 100644 index 0000000..93030e1 --- /dev/null +++ b/spec/models/export_resource_type_spec.rb @@ -0,0 +1,59 @@ +# #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::ExportResourceType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::ExportResourceType do + let(:instance) { Freeclimb::ExportResourceType.new } + + describe "test an instance of ExportResourceType" do + it "should create an instance of ExportResourceType" do + expect(instance).to be_instance_of(Freeclimb::ExportResourceType) + end + end + + describe 'test attribute "MESSAGES"' do + it "should work" do + expect { Freeclimb::ExportResourceType::MESSAGES = "Messages" }.not_to raise_error + end + it "should serialize to enum" do + expectedValue = Freeclimb::ExportResourceType::MESSAGES + calculatedValue = Freeclimb::ExportResourceType.build_from_hash("Messages") + expect(expectedValue).to eq(calculatedValue) + end + it "should deserialize to string" do + expectedValue = "Messages" + calculatedValue = Freeclimb::ExportResourceType::MESSAGES + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "CALLS"' do + it "should work" do + expect { Freeclimb::ExportResourceType::CALLS = "Calls" }.not_to raise_error + end + it "should serialize to enum" do + expectedValue = Freeclimb::ExportResourceType::CALLS + calculatedValue = Freeclimb::ExportResourceType.build_from_hash("Calls") + expect(expectedValue).to eq(calculatedValue) + end + it "should deserialize to string" do + expectedValue = "Calls" + calculatedValue = Freeclimb::ExportResourceType::CALLS + expect(expectedValue).to eq(calculatedValue) + end + end +end diff --git a/spec/models/export_result_output_spec.rb b/spec/models/export_result_output_spec.rb new file mode 100644 index 0000000..3f03506 --- /dev/null +++ b/spec/models/export_result_output_spec.rb @@ -0,0 +1,162 @@ +# #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::ExportResultOutput +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::ExportResultOutput do + let(:instance) { Freeclimb::ExportResultOutput.new } + + describe "test an instance of ExportResultOutput" do + it "should create an instance of ExportResultOutput" do + expect(instance).to be_instance_of(Freeclimb::ExportResultOutput) + end + end + + describe 'test attribute "type"' do + it "assigns value CSV" do + instance.type = Freeclimb::ExportOutputType::CSV + expect(instance.type).to eq(Freeclimb::ExportOutputType::CSV) + end + end + describe 'test method "initialize"' do + it "properly initializes with values" do + expect { + Freeclimb::ExportResultOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + }.not_to raise_error + end + it "fails to initialize with input argument that is not a hash in Freeclimb::ExportResultOutput" do + expect { + Freeclimb::ExportResultOutput.new( + type: Freeclimb::ExportOutputType::CSV, + + invalid_attribute: true + ) + }.to raise_error(ArgumentError) + end + it "fails to initialize with invalid attribute" do + expect { + Freeclimb::ExportResultOutput.new( + type: Freeclimb::ExportOutputType::CSV, + + invalid_attribute: true + ) + }.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it "checks if properties are valid" do + instance = Freeclimb::ExportResultOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + expect(instance.valid?).to eq(true) + end + + skip "checks if properties are invalid" do + instance = Freeclimb::ExportResultOutput.new + + expect(instance.valid?).to eq(false) + end + end + + describe 'test method "eql?"' do + it "checks if objects are equal" do + instance_1 = Freeclimb::ExportResultOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + instance_2 = Freeclimb::ExportResultOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it "checks if objects are not equal" do + instance_1 = Freeclimb::ExportResultOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + instance_2 = Freeclimb::ExportResultOutput.new( + type: nil + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it "calculates hash code" do + instance = Freeclimb::ExportResultOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + 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::ExportResultOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + instance_2 = Freeclimb::ExportResultOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + + 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 + Freeclimb::ExportResultOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + end + + describe 'test method "to_s"' do + it "returns the string representation of the object" do + instance = Freeclimb::ExportResultOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + 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::ExportResultOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it "creates equal hash for two equal objects" do + instance_1 = Freeclimb::ExportResultOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + instance_2 = Freeclimb::ExportResultOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::ExportResultOutput.new( + type: Freeclimb::ExportOutputType::CSV + ) + it "returns type in the form of hash" do + expect(instance._to_hash(instance.type)).to eq(instance.type) + end + end +end diff --git a/spec/models/export_result_spec.rb b/spec/models/export_result_spec.rb new file mode 100644 index 0000000..fb771b4 --- /dev/null +++ b/spec/models/export_result_spec.rb @@ -0,0 +1,718 @@ +# #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::ExportResult +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::ExportResult do + let(:instance) { Freeclimb::ExportResult.new } + + describe "test an instance of ExportResult" do + it "should create an instance of ExportResult" do + expect(instance).to be_instance_of(Freeclimb::ExportResult) + 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 "uri"' do + it "should work" do + instance.uri = "TEST_STRING" + expect(instance.uri).to eq("TEST_STRING") + end + end + + describe 'test attribute "date_created"' do + it "should work" do + instance.date_created = "TEST_STRING" + expect(instance.date_created).to eq("TEST_STRING") + end + end + + describe 'test attribute "date_updated"' do + it "should work" do + instance.date_updated = "TEST_STRING" + expect(instance.date_updated).to eq("TEST_STRING") + end + end + + describe 'test attribute "revision"' do + it "should work" do + instance.revision = 0 + expect(instance.revision).to eq(0) + end + end + + describe 'test attribute "export_id"' do + it "should work" do + instance.export_id = "TEST_STRING" + expect(instance.export_id).to eq("TEST_STRING") + end + end + + describe 'test attribute "status"' do + it "assigns value INTAKING" do + instance.status = Freeclimb::ExportStatus::INTAKING + expect(instance.status).to eq(Freeclimb::ExportStatus::INTAKING) + end + it "assigns value QUEUED" do + instance.status = Freeclimb::ExportStatus::QUEUED + expect(instance.status).to eq(Freeclimb::ExportStatus::QUEUED) + end + it "assigns value IN_PROGRESS" do + instance.status = Freeclimb::ExportStatus::IN_PROGRESS + expect(instance.status).to eq(Freeclimb::ExportStatus::IN_PROGRESS) + end + it "assigns value COMPLETED" do + instance.status = Freeclimb::ExportStatus::COMPLETED + expect(instance.status).to eq(Freeclimb::ExportStatus::COMPLETED) + end + it "assigns value FAILED" do + instance.status = Freeclimb::ExportStatus::FAILED + expect(instance.status).to eq(Freeclimb::ExportStatus::FAILED) + end + it "assigns value DELETED" do + instance.status = Freeclimb::ExportStatus::DELETED + expect(instance.status).to eq(Freeclimb::ExportStatus::DELETED) + end + end + describe 'test attribute "size"' do + it "should work" do + instance.size = 1 + expect(instance.size).to eq(1) + end + end + + describe 'test attribute "resource_type"' do + it "assigns value MESSAGES" do + instance.resource_type = Freeclimb::ExportResourceType::MESSAGES + expect(instance.resource_type).to eq(Freeclimb::ExportResourceType::MESSAGES) + end + it "assigns value CALLS" do + instance.resource_type = Freeclimb::ExportResourceType::CALLS + expect(instance.resource_type).to eq(Freeclimb::ExportResourceType::CALLS) + end + end + describe 'test attribute "query"' do + it "should work" do + testObject = Object.new + instance.query = testObject + expect(instance.query).to eq(testObject) + + instance.query = Object.new + expect(instance.query).to be_instance_of(Object) + end + end + + describe 'test attribute "format"' do + it "should work" do + instance.format = ["ELEMENT_1", "ELEMENT_2"] + expect(instance.format).to eq(["ELEMENT_1", "ELEMENT_2"]) + end + end + + describe 'test attribute "output"' do + it "should work" do + instance.output = ExportResultOutput.new + expect(instance.output).to be_instance_of(ExportResultOutput) + end + end + + describe 'test method "initialize"' do + it "properly initializes with values" do + expect { + Freeclimb::ExportResult.new( + account_id: "TS", + + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 0, + + export_id: "TS", + + status: Freeclimb::ExportStatus::INTAKING, + + size: 1, + + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + query: Object.new, + + format: [], + + output: ExportResultOutput.new + ) + }.not_to raise_error + end + it "fails to initialize with input argument that is not a hash in Freeclimb::ExportResult" do + expect { + Freeclimb::ExportResult.new( + account_id: "TS", + + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 0, + + export_id: "TS", + + status: Freeclimb::ExportStatus::INTAKING, + + size: 1, + + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + query: Object.new, + + format: [], + + output: ExportResultOutput.new, + + invalid_attribute: true + ) + }.to raise_error(ArgumentError) + end + it "fails to initialize with invalid attribute" do + expect { + Freeclimb::ExportResult.new( + account_id: "TS", + + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 0, + + export_id: "TS", + + status: Freeclimb::ExportStatus::INTAKING, + + size: 1, + + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + query: Object.new, + + format: [], + + output: ExportResultOutput.new, + + invalid_attribute: true + ) + }.to raise_error(ArgumentError) + end + end + + describe 'test method "valid"' do + it "checks if properties are valid" do + instance = Freeclimb::ExportResult.new( + account_id: "TS", + + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 0, + + export_id: "TS", + + status: Freeclimb::ExportStatus::INTAKING, + + size: 1, + + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + query: Object.new, + + format: [], + + output: ExportResultOutput.new + ) + expect(instance.valid?).to eq(true) + end + + skip "checks if properties are invalid" do + instance = Freeclimb::ExportResult.new + + expect(instance.valid?).to eq(false) + end + end + + describe 'test method "eql?"' do + it "checks if objects are equal" do + obj_Object = Object.new + + obj_ExportResultOutput = ExportResultOutput.new + + instance_1 = Freeclimb::ExportResult.new( + account_id: "TS", + + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 0, + + export_id: "TS", + + status: Freeclimb::ExportStatus::INTAKING, + + size: 1, + + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + query: obj_Object, + + format: [], + + output: obj_ExportResultOutput + ) + instance_2 = Freeclimb::ExportResult.new( + account_id: "TS", + + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 0, + + export_id: "TS", + + status: Freeclimb::ExportStatus::INTAKING, + + size: 1, + + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + query: obj_Object, + + format: [], + + output: obj_ExportResultOutput + ) + expect(instance_1.eql?(instance_2)).to eq(true) + end + + it "checks if objects are not equal" do + instance_1 = Freeclimb::ExportResult.new( + account_id: "TS", + + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 0 + 1, + + export_id: "TS", + + status: Freeclimb::ExportStatus::INTAKING, + + size: 2, + + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + query: Object.new, + + query: Object.new, + + format: [], + + output: ExportResultOutput.new + ) + instance_2 = Freeclimb::ExportResult.new( + account_id: "ST", + + uri: "ST", + + date_created: "ST", + + date_updated: "ST", + + revision: 0 + 2, + + export_id: "ST", + + status: nil, + + size: 1, + + resource_type: nil, + + query: Object.new, + + format: nil, + + output: ExportResultOutput.new + ) + expect(instance_1.eql?(instance_2)).to eq(false) + end + end + + describe 'test method "hash"' do + it "calculates hash code" do + instance = Freeclimb::ExportResult.new( + account_id: "TS", + + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 0, + + export_id: "TS", + + status: Freeclimb::ExportStatus::INTAKING, + + size: 1, + + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + query: Object.new, + + format: [], + + output: ExportResultOutput.new + ) + expect(instance.hash).to be_a_kind_of(Integer) + end + end + + describe 'test method "build_from_hash"' do + it "builds equivalent model from hash code" do + instance_1 = Freeclimb::ExportResult.new( + account_id: "TS", + + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 0, + + export_id: "TS", + + status: Freeclimb::ExportStatus::INTAKING, + + size: 1, + + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + query: Object.new, + + format: [], + + output: ExportResultOutput.new + ) + instance_2 = Freeclimb::ExportResult.new( + account_id: "TS", + + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 0, + + export_id: "TS", + + status: Freeclimb::ExportStatus::INTAKING, + + size: 1, + + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + query: Object.new, + + format: [], + + output: ExportResultOutput.new + ) + + expect(instance_2.build_from_hash(instance_1.hash)).to eq(instance_1.build_from_hash(instance_1.hash)) + end + end + + describe 'test method "_deserialize"' do + instance = Freeclimb::ExportResult.new( + account_id: "TS", + + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 0, + + export_id: "TS", + + status: Freeclimb::ExportStatus::INTAKING, + + size: 1, + + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + query: Object.new, + + format: [], + + output: ExportResultOutput.new + ) + 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 uri" do + expect(instance._deserialize("String", instance.uri)).to be_a_kind_of(String) + end + + it "deserializes the data of date_created" do + expect(instance._deserialize("String", instance.date_created)).to be_a_kind_of(String) + end + + it "deserializes the data of date_updated" do + expect(instance._deserialize("String", instance.date_updated)).to be_a_kind_of(String) + end + + it "deserializes the data of revision" do + expect(instance._deserialize("Integer", instance.revision)).to be_a_kind_of(Integer) + end + + it "deserializes the data of export_id" do + expect(instance._deserialize("String", instance.export_id)).to be_a_kind_of(String) + end + + it "deserializes the data of size" do + expect(instance._deserialize("Integer", instance.size)).to be_a_kind_of(Integer) + end + + it "deserializes the data of query" do + expect(instance._deserialize("Object", instance.query)).to be_a_kind_of(Object) + end + + it "deserializes the data of format" do + expect(instance._deserialize("Array", instance.format)).to be_a_kind_of(Array) + end + + it "deserializes the data of output" do + expect(instance._deserialize("Object", instance.output)).to be_a_kind_of(ExportResultOutput) + end + end + + describe 'test method "to_s"' do + it "returns the string representation of the object" do + instance = Freeclimb::ExportResult.new( + account_id: "TS", + + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 0, + + export_id: "TS", + + status: Freeclimb::ExportStatus::INTAKING, + + size: 1, + + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + query: Object.new, + + format: [], + + output: ExportResultOutput.new + ) + 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::ExportResult.new( + account_id: "TS", + + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 0, + + export_id: "TS", + + status: Freeclimb::ExportStatus::INTAKING, + + size: 1, + + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + query: Object.new, + + format: [], + + output: ExportResultOutput.new + ) + expect(instance.to_hash).to be_a_kind_of(Hash) + end + it "creates equal hash for two equal objects" do + Object.new + + obj = ExportResultOutput.new + + instance_1 = Freeclimb::ExportResult.new( + account_id: "TS", + + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 0, + + export_id: "TS", + + status: Freeclimb::ExportStatus::INTAKING, + + size: 1, + + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + query: obj, + + format: [], + + output: obj + ) + instance_2 = Freeclimb::ExportResult.new( + account_id: "TS", + + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 0, + + export_id: "TS", + + status: Freeclimb::ExportStatus::INTAKING, + + size: 1, + + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + query: obj, + + format: [], + + output: obj + ) + expect(instance_1.to_hash).to eq(instance_2.to_hash) + end + end + + describe 'test method "_to_hash"' do + instance = Freeclimb::ExportResult.new( + account_id: "TS", + + uri: "TS", + + date_created: "TS", + + date_updated: "TS", + + revision: 0, + + export_id: "TS", + + status: Freeclimb::ExportStatus::INTAKING, + + size: 1, + + resource_type: Freeclimb::ExportResourceType::MESSAGES, + + format: [] + ) + 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 uri in the form of hash" do + expect(instance._to_hash(instance.uri)).to eq(instance.uri) + end + it "returns date_created in the form of hash" do + expect(instance._to_hash(instance.date_created)).to eq(instance.date_created) + end + it "returns date_updated in the form of hash" do + expect(instance._to_hash(instance.date_updated)).to eq(instance.date_updated) + end + it "returns revision in the form of hash" do + expect(instance._to_hash(instance.revision)).to eq(instance.revision) + end + it "returns export_id in the form of hash" do + expect(instance._to_hash(instance.export_id)).to eq(instance.export_id) + end + it "returns status in the form of hash" do + expect(instance._to_hash(instance.status)).to eq(instance.status) + end + it "returns size in the form of hash" do + expect(instance._to_hash(instance.size)).to eq(instance.size) + end + it "returns resource_type in the form of hash" do + expect(instance._to_hash(instance.resource_type)).to eq(instance.resource_type) + end + it "returns query in the form of hash" do + expect(instance._to_hash(instance.query)).to eq(instance.query) + end + it "returns format in the form of hash" do + expect(instance._to_hash(instance.format)).to eq(instance.format) + end + it "returns output in the form of hash" do + expect(instance._to_hash(instance.output)).to eq(instance.output) + end + end +end diff --git a/spec/models/export_status_spec.rb b/spec/models/export_status_spec.rb new file mode 100644 index 0000000..88c8467 --- /dev/null +++ b/spec/models/export_status_spec.rb @@ -0,0 +1,123 @@ +# #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::ExportStatus +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe Freeclimb::ExportStatus do + let(:instance) { Freeclimb::ExportStatus.new } + + describe "test an instance of ExportStatus" do + it "should create an instance of ExportStatus" do + expect(instance).to be_instance_of(Freeclimb::ExportStatus) + end + end + + describe 'test attribute "INTAKING"' do + it "should work" do + expect { Freeclimb::ExportStatus::INTAKING = "intaking" }.not_to raise_error + end + it "should serialize to enum" do + expectedValue = Freeclimb::ExportStatus::INTAKING + calculatedValue = Freeclimb::ExportStatus.build_from_hash("intaking") + expect(expectedValue).to eq(calculatedValue) + end + it "should deserialize to string" do + expectedValue = "intaking" + calculatedValue = Freeclimb::ExportStatus::INTAKING + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "QUEUED"' do + it "should work" do + expect { Freeclimb::ExportStatus::QUEUED = "queued" }.not_to raise_error + end + it "should serialize to enum" do + expectedValue = Freeclimb::ExportStatus::QUEUED + calculatedValue = Freeclimb::ExportStatus.build_from_hash("queued") + expect(expectedValue).to eq(calculatedValue) + end + it "should deserialize to string" do + expectedValue = "queued" + calculatedValue = Freeclimb::ExportStatus::QUEUED + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "IN_PROGRESS"' do + it "should work" do + expect { Freeclimb::ExportStatus::IN_PROGRESS = "inProgress" }.not_to raise_error + end + it "should serialize to enum" do + expectedValue = Freeclimb::ExportStatus::IN_PROGRESS + calculatedValue = Freeclimb::ExportStatus.build_from_hash("inProgress") + expect(expectedValue).to eq(calculatedValue) + end + it "should deserialize to string" do + expectedValue = "inProgress" + calculatedValue = Freeclimb::ExportStatus::IN_PROGRESS + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "COMPLETED"' do + it "should work" do + expect { Freeclimb::ExportStatus::COMPLETED = "completed" }.not_to raise_error + end + it "should serialize to enum" do + expectedValue = Freeclimb::ExportStatus::COMPLETED + calculatedValue = Freeclimb::ExportStatus.build_from_hash("completed") + expect(expectedValue).to eq(calculatedValue) + end + it "should deserialize to string" do + expectedValue = "completed" + calculatedValue = Freeclimb::ExportStatus::COMPLETED + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "FAILED"' do + it "should work" do + expect { Freeclimb::ExportStatus::FAILED = "failed" }.not_to raise_error + end + it "should serialize to enum" do + expectedValue = Freeclimb::ExportStatus::FAILED + calculatedValue = Freeclimb::ExportStatus.build_from_hash("failed") + expect(expectedValue).to eq(calculatedValue) + end + it "should deserialize to string" do + expectedValue = "failed" + calculatedValue = Freeclimb::ExportStatus::FAILED + expect(expectedValue).to eq(calculatedValue) + end + end + + describe 'test attribute "DELETED"' do + it "should work" do + expect { Freeclimb::ExportStatus::DELETED = "deleted" }.not_to raise_error + end + it "should serialize to enum" do + expectedValue = Freeclimb::ExportStatus::DELETED + calculatedValue = Freeclimb::ExportStatus.build_from_hash("deleted") + expect(expectedValue).to eq(calculatedValue) + end + it "should deserialize to string" do + expectedValue = "deleted" + calculatedValue = Freeclimb::ExportStatus::DELETED + expect(expectedValue).to eq(calculatedValue) + end + end +end diff --git a/yarn.lock b/yarn.lock index d3626ee..a920794 100644 --- a/yarn.lock +++ b/yarn.lock @@ -145,9 +145,9 @@ tslib "^2.3.1" "@stoplight/prism-http-server@^5.6.0": - version "5.12.0" - resolved "https://registry.yarnpkg.com/@stoplight/prism-http-server/-/prism-http-server-5.12.0.tgz#c1fdc86bcb7d42d3420b9b84f05f9ae8977bc953" - integrity sha512-rnACUB950kvgDGXk1MsVk1v8nAZNCRaxdrTlACoJpQA0qzF8eBszYikoDsVmx2BbGsOrCC/49+nQc+HyFFpMdQ== + 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== dependencies: "@stoplight/prism-core" "^5.8.0" "@stoplight/prism-http" "^5.12.0" @@ -252,11 +252,11 @@ integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/node@*": - version "22.10.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.5.tgz#95af89a3fb74a2bb41ef9927f206e6472026e48b" - integrity sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ== + version "24.5.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-24.5.2.tgz#52ceb83f50fe0fcfdfbd2a9fab6db2e9e7ef6446" + integrity sha512-FYxk1I7wPv3K2XBaoyH2cTnocQEu8AOZ60hPbsyukMPLv5/5qr7V1i8PLHdl6Zf87I+xZXFvPCXYjiTFq+YSDQ== dependencies: - undici-types "~6.20.0" + undici-types "~7.12.0" "@types/swagger-schema-official@~2.0.22": version "2.0.25" @@ -264,9 +264,9 @@ integrity sha512-T92Xav+Gf/Ik1uPW581nA+JftmjWPgskw/WBf4TJzxRG/SJ+DfNnNE+WuZ4mrXuzflQMqMkm1LSYjzYW7MB1Cg== "@types/type-is@^1.6.3": - version "1.6.6" - resolved "https://registry.yarnpkg.com/@types/type-is/-/type-is-1.6.6.tgz#0adeafa0d6879f0ce17c81228d487270e8b80d7d" - integrity sha512-fs1KHv/f9OvmTMsu4sBNaUu32oyda9Y9uK25naJG8gayxNrfqGIjPQsbLIYyfe7xFkppnPlJB+BuTldOaX9bXw== + version "1.6.7" + resolved "https://registry.yarnpkg.com/@types/type-is/-/type-is-1.6.7.tgz#4d7934d2c795749800e767cd9af7ffbd4f16cf1c" + integrity sha512-gEsh7n8824nusZ2Sidh6POxNsIdTSvIAl5gXbeFj+TUaD1CO2r4i7MQYNMfEQkChU42s2bVWAda6x6BzIhtFbQ== dependencies: "@types/node" "*" @@ -475,9 +475,9 @@ cross-fetch@^3.1.5: node-fetch "^2.7.0" debug@4: - version "4.4.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" - integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== + version "4.4.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.3.tgz#c6ae432d9bd9662582fce08709b038c58e9e3d6a" + integrity sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA== dependencies: ms "^2.1.3" @@ -487,9 +487,9 @@ emoji-regex@^8.0.0: integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + version "1.3.4" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.4.tgz#b3a8d8bb6f92eecc1629e3e27d3c8607a8a32414" + integrity sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ== dependencies: is-arrayish "^0.2.1" @@ -524,9 +524,9 @@ fast-safe-stringify@^2.0.8: integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== fast-uri@^3.0.1: - version "3.0.5" - resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.5.tgz#19f5f9691d0dab9b85861a7bb5d98fca961da9cd" - integrity sha512-5JnBCWpFlMo0a3ciDy/JckMzzv1U9coZrIhedq+HXxxUfDTAiS0LA8OKVao4G9BxmCVck/jtA5r3KAtRWEyD8Q== + version "3.1.0" + 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: version "4.5.1" @@ -587,9 +587,9 @@ format-util@^1.0.3: integrity sha512-varLbTj0e0yVyRpqQhuWV+8hlePAgaoFRhNFj50BNjEIrw1/DphHSObtqwskVCPWNgzwPoQrZAbfa/SBiicNeg== fp-ts@^2.11.5: - version "2.16.9" - resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-2.16.9.tgz#99628fc5e0bb3b432c4a16d8f4455247380bae8a" - integrity sha512-+I2+FnVB+tVaxcYyQkHUq7ZdKScaBlX53A41mxQtpIccsfyv8PzdzP7fzp2AY832T4aoK6UZ5WRX/ebGd8uZuQ== + version "2.16.11" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-2.16.11.tgz#831a10514bf4e22adf12065732fc5a20c85d9623" + integrity sha512-LaI+KaX2NFkfn1ZGHoKCmcfv7yrZsC3b8NtWsTVQeHkq4F27vI5igUuO53sxqDEa2gNQMHFPmpojDw/1zmUK7w== fsevents@~2.3.2: version "2.3.3" @@ -1156,9 +1156,9 @@ strip-bom@^3.0.0: integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== strnum@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/strnum/-/strnum-1.0.5.tgz#5c4e829fe15ad4ff0d20c3db5ac97b73c9b072db" - integrity sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA== + version "1.1.2" + resolved "https://registry.yarnpkg.com/strnum/-/strnum-1.1.2.tgz#57bca4fbaa6f271081715dbc9ed7cee5493e28e4" + integrity sha512-vrN+B7DBIoTTZjnPNewwhx6cBA/H+IS7rfW68n7XxC1y7uoiGQBxaKzqucGUgavX15dJgiGztLJ8vxuEzwqBdA== supports-color@^5.3.0: version "5.5.0" @@ -1199,10 +1199,10 @@ type-is@^1.6.18: media-typer "0.3.0" mime-types "~2.1.24" -undici-types@~6.20.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" - integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== +undici-types@~7.12.0: + version "7.12.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.12.0.tgz#15c5c7475c2a3ba30659529f5cdb4674b622fafb" + integrity sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ== uri-template-lite@^22.9.0: version "22.9.0"