Skip to main content

gong_rs/models/
new_call_adding_request.rs

1/*
2 * Gong API
3 *
4 * <h2>Overview</h2> <p> The Gong API allows you to: </p> <ol> <li> Receive the following information from Gong: <ol type=\"a\"> <li> Your company's <a href=\"#tag--Calls\">calls</a> in Gong </li> <li> Your company's <a href=\"#tag--Users\">users</a> in Gong </li> <li> Your company's user <a href=\"#tag--Stats\">stats</a> in Gong </li> <li> Your company's user <a href=\"#tag--Settings\">settings</a> in Gong </li> <li> Your company's <a href=\"#tag--Library\">libraries</a> in Gong </li> </ol></li> <li> <a href=\"#post-/v2/calls\">Upload</a> new or  <a href=\"#put-/v2/calls/-id-/media\">update</a>  call recordings in Gong, in order to support cases where you have an internal system that records  calls or obtains them from a third-party entity. </li> <li> <a href=\"#post-/v2/data-privacy/erase-data-for-email-address\">Data Privacy</a>:  Delete users and all their associated elements.</li> <li> Upload <a href=\"#tag--CRM\">CRM</a> data into Gong.  </li> </ol> <p>Check <a href=\"https://app.gong.io/company/api-authentication?currentTab=MY_API_TAB\">here</a> what's your base URL for all API calls. </p> <h2>Authentication</h2>  <p> There are two ways to retrieve credentials to the Gong Public API: </p> <ol><li>Retrieve Manually:<br> <p> In the <a href=\"https://app.gong.io/company/api\">Gong API Page</a> (you must be a technical administrator in Gong), click \"Create\" to receive an <b>Access Key</b>  and an <b>Access Key Secret</b>.<br> </p> <p> Use the Basic Authorization HTTP header (as per <a target=\"_blank\" href=\"https://www.rfc-editor.org/rfc/rfc7617.txt\">RFC</a>) to access the Public API as shown below:<br> <code>Authorization: Basic &lt;token&gt;</code><br> </p> <p> To create the basic token, combine the <b>Access Key</b> and the <b>Access Key Secret</b> with  colon (:) and then encode in Base64 as following:<br> <code>Base64(&lt;accessKey&gt; : &lt;accessKeySecret&gt;)</code><br><br> </p></li> <li>Retrieve through OAuth<br> <p> To obtain the Bearer token, follow the steps described in the <a target=\"_blank\" href=\"https://help.gong.io/hc/en-us/articles/13944551222157-Create-an-app-for-Gong\">Gong OAuth Guide</a>. <br></p> <p> After obtaining the token, use the Bearer Authorization HTTP header (as per <a target=\"_blank\" href=\"https://www.rfc-editor.org/rfc/rfc6750.txt\">RFC</a>) to access the Public API as shown below:<br> <code>Authorization: Bearer &lt;token&gt;</code> </p> </li></ol> <h2>Limits</h2>  <p> By default Gong limits your company's access to the service to 3 API calls per second, and 10,000 API calls per day. </p> <p> When the rate of API calls exceeds these limits an HTTP status code <b>429</b> is returned and a <b>Retry-After</b> header indicates  how many seconds to wait before making a new request. </p><p> If required, contact <a target=\"_blank\" href=\"https://help.gong.io\">help.gong.io</a> to change these limits. </p>  <h2>Cursors</h2>  <p> Some API calls that return a list are limited in the amount of records they may return, so multiple API calls may be  required to bring all records. Such an API call also returns a <b>records</b> field, which contains the number of records  in the current page, the current page number and the total number of records. </p> <p> In cases where the total number of records exceeds the number of records thus far retrieved, the <b>records</b> field will also  contain a <b>cursor</b> field which can be used to access the next page of records. To retrieve the next page, repeat the API call with  the <b>cursor</b> value as supplied by the previous API call. All other request inputs should remain the same. </p> <h2>Forward Compatibility</h2>  <p> When coding a system to accept Gong data, take into account that Gong may, without prior warning, add fields to the JSON output.  It is recommended to future proof your code so that it disregards all JSON fields you don't actually use.  </p><p></p>
5 *
6 * The version of the OpenAPI document: V2
7 * Contact: mail@cedric-ziel.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// NewCallAddingRequest : New call metadata
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct NewCallAddingRequest {
17    /// A call's unique identifier in the PBX or the recording system. Gong uses this identifier to prevent repeated attempts to upload the same recording.
18    #[serde(rename = "clientUniqueId")]
19    pub client_unique_id: String,
20    /// The title of the call. This title is available in the Gong system for indexing and search.
21    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
22    pub title: Option<String>,
23    /// The purpose of the call. This optional field is a free text of up to 255 characters.
24    #[serde(rename = "purpose", skip_serializing_if = "Option::is_none")]
25    pub purpose: Option<String>,
26    /// The date and time the call was scheduled to begin in the ISO-8601 format (e.g., '2018-02-18T02:30:00-07:00' or '2018-02-18T08:00:00Z', where Z stands for UTC);
27    #[serde(rename = "scheduledStart", skip_serializing_if = "Option::is_none")]
28    pub scheduled_start: Option<String>,
29    /// The date and time the call was scheduled to end in the ISO-8601 format (e.g., '2018-02-18T02:30:00-07:00' or '2018-02-18T08:00:00Z', where Z stands for UTC);
30    #[serde(rename = "scheduledEnd", skip_serializing_if = "Option::is_none")]
31    pub scheduled_end: Option<String>,
32    /// The actual date and time when the call started in the ISO-8601 format (e.g., '2018-02-18T02:30:00-07:00' or '2018-02-18T08:00:00Z', where Z stands for UTC);
33    #[serde(rename = "actualStart")]
34    pub actual_start: String,
35    /// The actual call duration in seconds.
36    #[serde(rename = "duration", skip_serializing_if = "Option::is_none")]
37    pub duration: Option<f32>,
38    /// A list of the call's participants. A party must be provided for the primaryUser.
39    #[serde(rename = "parties")]
40    pub parties: Vec<models::CallParticipant>,
41    /// Whether the call is inbound (someone called the company), outbound (a rep dialed someone outside the company), or a conference call.
42    #[serde(rename = "direction")]
43    pub direction: Direction,
44    /// The disposition of the call. The disposition is free text of up to 255 characters.
45    #[serde(rename = "disposition", skip_serializing_if = "Option::is_none")]
46    pub disposition: Option<String>,
47    /// A list of references to external systems such as CRM, Telephony System, Case Management, etc.
48    #[serde(rename = "context", skip_serializing_if = "Option::is_none")]
49    pub context: Option<Vec<models::CallUploadContext>>,
50    /// Optional metadata associated with the call (represented as text). Gong stores this metadata and it can be used for troubleshooting.
51    #[serde(rename = "customData", skip_serializing_if = "Option::is_none")]
52    pub custom_data: Option<String>,
53    #[serde(rename = "speakersTimeline", skip_serializing_if = "Option::is_none")]
54    pub speakers_timeline: Option<Box<models::SpeakersTimeline>>,
55    /// The URL of the conference call by which users join the meeting
56    #[serde(rename = "meetingUrl", skip_serializing_if = "Option::is_none")]
57    pub meeting_url: Option<String>,
58    /// The code identifies the provider conferencing or telephony system. For example: zoom, clearslide, gotomeeting, ringcentral, outreach, insidesales, etc. These values are predefined by Gong, please contact help@gong.io to find the proper value for your system.
59    #[serde(rename = "callProviderCode", skip_serializing_if = "Option::is_none")]
60    pub call_provider_code: Option<String>,
61    /// The URL from which Gong can download the media file. The URL must be unique, the audio or video file must be a maximum of 1.5GB. The content-type must either start with 'audio' or 'video,' or should be 'application/octet-stream' or 'binary/octet-stream' followed by a subtype that specifies a supported file type (WAV, MP3, MP4, MKV and FLAC). If you provide this URL, you should not perform the 'Add call media' step.
62    #[serde(rename = "downloadMediaUrl", skip_serializing_if = "Option::is_none")]
63    pub download_media_url: Option<String>,
64    /// Optional workspace identifier. If specified, the call will be placed into this workspace, otherwise, the default algorithm for workspace placement will be applied.
65    #[serde(rename = "workspaceId", skip_serializing_if = "Option::is_none")]
66    pub workspace_id: Option<String>,
67    /// The language code the call should be transcribed to. This field is optional as Gong automatically detects the language spoken in the call and transcribes it accordingly. Set this field only if you are sure of the language the call is in. Valid values are: af-ZA, am-ET, ar-AE, ar-BH, ar-DZ, ar-EG, ar-IL, ar-IQ, ar-JO, ar-KW, ar-LB, ar-MA, ar-MR, ar-OM, ar-PS, ar-QA, ar-SA, ar-TN, ar-YE, az-AZ, bg-BG, bn-BD, bn-IN, bs-BA, ca-ES, cs-CZ, da-DK, de-AT, de-CH, de-DE, el-GR, en-AB, en-AU, en-CA, en-GB, en-IE, en-IN, en-NZ, en-PH, en-SG, en-US, en-WL, en-ZA, es-AR, es-BO, es-CL, es-CO, es-CR, es-DO, es-EC, es-ES, es-GT, es-HN, es-MX, es-NI, es-PA, es-PE, es-PR, es-PY, es-SV, es-US, es-UY, et-EE, eu-ES, fa-IR, fi-FI, fil-PH, fr-BE, fr-CA, fr-CH, fr-FR, gl-ES, gu-IN, he-IL, hi-IN, hr-HR, hu-HU, hy-AM, id-ID, is-IS, it-CH, it-IT, ja-JP, jv-ID, ka-GE, kk-KZ, km-KH, kn-IN, ko-KR, lo-LA, lt-LT, lv-LV, mk-MK, ml-IN, mn-MN, mr-IN, ms-MY, my-MM, ne-NP, nl-BE, nl-NL, no-NO, pa-Guru-IN, pl-PL, pt-BR, pt-PT, ro-RO, ru-RU, si-LK, sk-SK, sl-SI, sq-AL, sr-RS, su-ID, sv-SE, sw-KE, sw-TZ, ta-IN, ta-LK, ta-MY, ta-SG, te-IN, th-TH, tr-TR, uk-UA, ur-IN, ur-PK, uz-UZ, vi-VN, yue-Hant-HK, zh-CN, zh-TW, zu-ZA
68    #[serde(rename = "languageCode", skip_serializing_if = "Option::is_none")]
69    pub language_code: Option<String>,
70    /// The Gong internal user ID of the team member who hosted the call.
71    #[serde(rename = "primaryUser")]
72    pub primary_user: String,
73}
74
75impl NewCallAddingRequest {
76    /// New call metadata
77    pub fn new(client_unique_id: String, actual_start: String, parties: Vec<models::CallParticipant>, direction: Direction, primary_user: String) -> NewCallAddingRequest {
78        NewCallAddingRequest {
79            client_unique_id,
80            title: None,
81            purpose: None,
82            scheduled_start: None,
83            scheduled_end: None,
84            actual_start,
85            duration: None,
86            parties,
87            direction,
88            disposition: None,
89            context: None,
90            custom_data: None,
91            speakers_timeline: None,
92            meeting_url: None,
93            call_provider_code: None,
94            download_media_url: None,
95            workspace_id: None,
96            language_code: None,
97            primary_user,
98        }
99    }
100}
101/// Whether the call is inbound (someone called the company), outbound (a rep dialed someone outside the company), or a conference call.
102#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
103pub enum Direction {
104    #[serde(rename = "Inbound")]
105    Inbound,
106    #[serde(rename = "Outbound")]
107    Outbound,
108    #[serde(rename = "Conference")]
109    Conference,
110    #[serde(rename = "Unknown")]
111    Unknown,
112}
113
114impl Default for Direction {
115    fn default() -> Direction {
116        Self::Inbound
117    }
118}
119