Skip to main content

ghl_models/v3/
opportunities.rs

1// @generated by xtask/generate_models.py — do not edit by hand.
2// Source: https://github.com/GoHighLevel/highlevel-api-docs
3// Doc comments are HighLevel's own field descriptions, reflowed verbatim, so
4// they aren't held to rustdoc's markdown conventions.
5#![allow(
6    missing_docs,
7    clippy::doc_lazy_continuation,
8    clippy::doc_overindented_list_items
9)]
10
11use serde::{Deserialize, Serialize};
12
13/// `AdditionalDetailsDTO` from the GoHighLevel OpenAPI spec.
14#[derive(Debug, Clone, Default, Serialize, Deserialize)]
15pub struct AdditionalDetailsDTO {
16    /// Include notes in the response
17    /// Required by the API.
18    pub notes: bool,
19    /// Include tasks in the response
20    /// Required by the API.
21    pub tasks: bool,
22    /// Include calendar events in the response
23    /// Required by the API.
24    #[serde(rename = "calendarEvents")]
25    pub calendar_events: bool,
26    /// Include unread conversations count in the response
27    /// Required by the API.
28    #[serde(rename = "unReadConversations")]
29    pub un_read_conversations: bool,
30}
31
32/// `CreateAddFollowersSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
33#[derive(Debug, Clone, Default, Serialize, Deserialize)]
34pub struct CreateAddFollowersSuccessfulResponseDto {
35    /// Current list of all follower user IDs after the operation
36    #[serde(default, skip_serializing_if = "Vec::is_empty")]
37    pub followers: Vec<String>,
38    /// User IDs that were successfully added as followers
39    #[serde(
40        rename = "followersAdded",
41        default,
42        skip_serializing_if = "Vec::is_empty"
43    )]
44    pub followers_added: Vec<String>,
45}
46
47/// `CreateDtoV3` from the GoHighLevel OpenAPI spec.
48#[derive(Debug, Clone, Default, Serialize, Deserialize)]
49pub struct CreateDtoV3 {
50    /// pipeline Id
51    /// Required by the API.
52    #[serde(rename = "pipelineId")]
53    pub pipeline_id: String,
54    /// Identifier of the location (sub-account)
55    /// Required by the API.
56    #[serde(rename = "locationId")]
57    pub location_id: String,
58    /// Name of the opportunity
59    /// Required by the API.
60    pub name: String,
61    /// Identifier of the pipeline stage
62    #[serde(
63        rename = "pipelineStageId",
64        default,
65        skip_serializing_if = "Option::is_none"
66    )]
67    pub pipeline_stage_id: Option<String>,
68    /// Current status of the opportunity
69    /// Allowed values: `open`, `won`, `lost`, `abandoned`, `all`.
70    /// Required by the API.
71    pub status: String,
72    /// Identifier of the contact linked to the opportunity
73    /// Required by the API.
74    #[serde(rename = "contactId")]
75    pub contact_id: String,
76    /// Monetary value of the opportunity
77    #[serde(
78        rename = "monetaryValue",
79        default,
80        skip_serializing_if = "Option::is_none"
81    )]
82    pub monetary_value: Option<f64>,
83    /// Expected close date. Supported formats: YYYY/MM/DD, MM/DD/YYYY, YYYY-MM-DD, MM-DD-YYYY,
84    /// YYYY.MM.DD, MM.DD.YYYY, or ISO 8601
85    #[serde(
86        rename = "forecastExpectedCloseDate",
87        default,
88        skip_serializing_if = "Option::is_none"
89    )]
90    pub forecast_expected_close_date: Option<String>,
91    /// Forecast probability
92    #[serde(
93        rename = "forecastProbability",
94        default,
95        skip_serializing_if = "Option::is_none"
96    )]
97    pub forecast_probability: Option<f64>,
98    /// Identifier of the user the opportunity is assigned to
99    #[serde(
100        rename = "assignedTo",
101        default,
102        skip_serializing_if = "Option::is_none"
103    )]
104    pub assigned_to: Option<String>,
105    /// Add custom fields to opportunities.
106    /// Multiple possible shapes in the spec; raw JSON.
107    #[serde(
108        rename = "customFields",
109        default,
110        skip_serializing_if = "Vec::is_empty"
111    )]
112    pub custom_fields: Vec<serde_json::Value>,
113}
114
115/// `CustomFieldResponseSchema` from the GoHighLevel OpenAPI spec.
116#[derive(Debug, Clone, Default, Serialize, Deserialize)]
117pub struct CustomFieldResponseSchema {
118    /// Unique identifier of the custom field
119    /// Required by the API.
120    pub id: String,
121    /// The value of the custom field
122    /// Multiple possible shapes in the spec; raw JSON.
123    /// Required by the API.
124    #[serde(rename = "fieldValue")]
125    pub field_value: serde_json::Value,
126}
127
128/// `DeleteFollowersSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
129#[derive(Debug, Clone, Default, Serialize, Deserialize)]
130pub struct DeleteFollowersSuccessfulResponseDto {
131    /// Current list of all follower user IDs after the operation
132    #[serde(default, skip_serializing_if = "Vec::is_empty")]
133    pub followers: Vec<String>,
134    /// User IDs that were successfully removed as followers
135    #[serde(
136        rename = "followersRemoved",
137        default,
138        skip_serializing_if = "Vec::is_empty"
139    )]
140    pub followers_removed: Vec<String>,
141}
142
143/// `DeleteUpdateOpportunitySuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
144#[derive(Debug, Clone, Default, Serialize, Deserialize)]
145pub struct DeleteUpdateOpportunitySuccessfulResponseDto {
146    /// Indicates whether the operation was successful. Deprecated — use `success` instead.
147    #[serde(default, skip_serializing_if = "Option::is_none")]
148    pub succeded: Option<bool>,
149    /// Indicates whether the operation was successful
150    #[serde(default, skip_serializing_if = "Option::is_none")]
151    pub success: Option<bool>,
152}
153
154/// `FollowersDTO` from the GoHighLevel OpenAPI spec.
155#[derive(Debug, Clone, Default, Serialize, Deserialize)]
156pub struct FollowersDTO {
157    /// Array of user IDs to add or remove as followers (max 10)
158    /// Required by the API.
159    #[serde(default, skip_serializing_if = "Vec::is_empty")]
160    pub followers: Vec<String>,
161}
162
163/// `GetPipelinesSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
164#[derive(Debug, Clone, Default, Serialize, Deserialize)]
165pub struct GetPipelinesSuccessfulResponseDto {
166    /// List of pipelines for the location
167    #[serde(default, skip_serializing_if = "Vec::is_empty")]
168    pub pipelines: Vec<PipelinesResponseSchema>,
169}
170
171/// `GetPostOpportunitySuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
172#[derive(Debug, Clone, Default, Serialize, Deserialize)]
173pub struct GetPostOpportunitySuccessfulResponseDto {
174    /// The created or retrieved opportunity object
175    #[serde(default, skip_serializing_if = "Option::is_none")]
176    pub opportunity: Option<SearchOpportunitiesResponseSchema>,
177}
178
179/// `LostReasonResponseSchema` from the GoHighLevel OpenAPI spec.
180#[derive(Debug, Clone, Default, Serialize, Deserialize)]
181pub struct LostReasonResponseSchema {
182    /// lost reason id
183    #[serde(default, skip_serializing_if = "Option::is_none")]
184    pub id: Option<String>,
185    /// lost reason name
186    #[serde(default, skip_serializing_if = "Option::is_none")]
187    pub name: Option<String>,
188    /// location id
189    #[serde(
190        rename = "locationId",
191        default,
192        skip_serializing_if = "Option::is_none"
193    )]
194    pub location_id: Option<String>,
195    /// updated at
196    /// Format: date-time (ISO-8601 string).
197    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
198    pub updated_at: Option<String>,
199    /// created at
200    /// Format: date-time (ISO-8601 string).
201    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
202    pub created_at: Option<String>,
203}
204
205/// `LostReasonsResponseSchema` from the GoHighLevel OpenAPI spec.
206#[derive(Debug, Clone, Default, Serialize, Deserialize)]
207pub struct LostReasonsResponseSchema {
208    /// List of lost reasons for the location
209    #[serde(rename = "lostReasons", default, skip_serializing_if = "Vec::is_empty")]
210    pub lost_reasons: Vec<LostReasonResponseSchema>,
211    /// Total number of lost reasons matching the query
212    #[serde(default, skip_serializing_if = "Option::is_none")]
213    pub total: Option<f64>,
214}
215
216/// `OpportunitySearchBodyDTO` from the GoHighLevel OpenAPI spec.
217#[derive(Debug, Clone, Default, Serialize, Deserialize)]
218pub struct OpportunitySearchBodyDTO {
219    /// Location Id
220    /// Required by the API.
221    #[serde(rename = "locationId")]
222    pub location_id: String,
223    /// Full-text search query string (max 75 characters)
224    /// Required by the API.
225    pub query: String,
226    /// Maximum number of results to return per page
227    /// Required by the API.
228    pub limit: f64,
229    /// Page number (0-indexed)
230    /// Required by the API.
231    pub page: f64,
232    /// Search-after cursor values for deep pagination
233    /// Required by the API.
234    #[serde(rename = "searchAfter", default, skip_serializing_if = "Vec::is_empty")]
235    pub search_after: Vec<String>,
236    /// Flags to include additional related entities in the response
237    /// Required by the API.
238    #[serde(rename = "additionalDetails")]
239    pub additional_details: AdditionalDetailsDTO,
240}
241
242/// `PipelinesResponseSchema` from the GoHighLevel OpenAPI spec.
243#[derive(Debug, Clone, Default, Serialize, Deserialize)]
244pub struct PipelinesResponseSchema {
245    /// Unique identifier of the pipeline
246    #[serde(default, skip_serializing_if = "Option::is_none")]
247    pub id: Option<String>,
248    /// Name of the pipeline
249    #[serde(default, skip_serializing_if = "Option::is_none")]
250    pub name: Option<String>,
251    /// Stages belonging to this pipeline
252    #[serde(default, skip_serializing_if = "Vec::is_empty")]
253    pub stages: Vec<Vec<serde_json::Value>>,
254    /// Whether the pipeline is shown in the funnel view
255    #[serde(
256        rename = "showInFunnel",
257        default,
258        skip_serializing_if = "Option::is_none"
259    )]
260    pub show_in_funnel: Option<bool>,
261    /// Whether the pipeline is shown in the pie chart view
262    #[serde(
263        rename = "showInPieChart",
264        default,
265        skip_serializing_if = "Option::is_none"
266    )]
267    pub show_in_pie_chart: Option<bool>,
268    /// Identifier of the location (sub-account) this pipeline belongs to
269    #[serde(
270        rename = "locationId",
271        default,
272        skip_serializing_if = "Option::is_none"
273    )]
274    pub location_id: Option<String>,
275    /// Whether stage-level win probability is enabled for this pipeline
276    #[serde(
277        rename = "useOpportunityProbability",
278        default,
279        skip_serializing_if = "Option::is_none"
280    )]
281    pub use_opportunity_probability: Option<bool>,
282    /// How pipeline/stage colors are rendered
283    /// Allowed values: `dot`, `bg-tint`, `none`.
284    #[serde(
285        rename = "colorRenderMode",
286        default,
287        skip_serializing_if = "Option::is_none"
288    )]
289    pub color_render_mode: Option<String>,
290}
291
292/// `PostSearchSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
293#[derive(Debug, Clone, Default, Serialize, Deserialize)]
294pub struct PostSearchSuccessfulResponseDto {
295    /// List of opportunities matching the search criteria
296    #[serde(default, skip_serializing_if = "Vec::is_empty")]
297    pub opportunities: Vec<SearchOpportunitiesResponseSchema>,
298    /// Total number of opportunities matching the query
299    /// Required by the API.
300    pub total: f64,
301    /// Per-stage totals when pipeline filter is present
302    #[serde(
303        rename = "stageAggregations",
304        default,
305        skip_serializing_if = "Vec::is_empty"
306    )]
307    pub stage_aggregations: Vec<StageAggregationResponseDto>,
308    /// Aggregation results keyed by aggregation name
309    #[serde(default, skip_serializing_if = "Option::is_none")]
310    pub aggregations: Option<serde_json::Value>,
311}
312
313/// `SearchMetaResponseSchema` from the GoHighLevel OpenAPI spec.
314#[derive(Debug, Clone, Default, Serialize, Deserialize)]
315pub struct SearchMetaResponseSchema {
316    /// Total number of opportunities matching the query
317    #[serde(default, skip_serializing_if = "Option::is_none")]
318    pub total: Option<f64>,
319    /// URL to retrieve the next page of results
320    #[serde(
321        rename = "nextPageUrl",
322        default,
323        skip_serializing_if = "Option::is_none"
324    )]
325    pub next_page_url: Option<String>,
326    /// Cursor id to use for pagination (startAfterId param)
327    #[serde(
328        rename = "startAfterId",
329        default,
330        skip_serializing_if = "Option::is_none"
331    )]
332    pub start_after_id: Option<String>,
333    /// Cursor timestamp to use for pagination (startAfter param)
334    #[serde(
335        rename = "startAfter",
336        default,
337        skip_serializing_if = "Option::is_none"
338    )]
339    pub start_after: Option<f64>,
340    /// Current page number
341    #[serde(
342        rename = "currentPage",
343        default,
344        skip_serializing_if = "Option::is_none"
345    )]
346    pub current_page: Option<f64>,
347    /// Next page number
348    #[serde(rename = "nextPage", default, skip_serializing_if = "Option::is_none")]
349    pub next_page: Option<f64>,
350    /// Previous page number
351    #[serde(rename = "prevPage", default, skip_serializing_if = "Option::is_none")]
352    pub prev_page: Option<f64>,
353}
354
355/// `SearchOpportunitiesContactResponseSchema` from the GoHighLevel OpenAPI spec.
356#[derive(Debug, Clone, Default, Serialize, Deserialize)]
357pub struct SearchOpportunitiesContactResponseSchema {
358    /// Unique identifier of the contact
359    #[serde(default, skip_serializing_if = "Option::is_none")]
360    pub id: Option<String>,
361    /// Full name of the contact
362    #[serde(default, skip_serializing_if = "Option::is_none")]
363    pub name: Option<String>,
364    /// Company name associated with the contact
365    #[serde(
366        rename = "companyName",
367        default,
368        skip_serializing_if = "Option::is_none"
369    )]
370    pub company_name: Option<String>,
371    /// Email address of the contact
372    #[serde(default, skip_serializing_if = "Option::is_none")]
373    pub email: Option<String>,
374    /// Phone number of the contact
375    #[serde(default, skip_serializing_if = "Option::is_none")]
376    pub phone: Option<String>,
377    /// Tags associated with the contact
378    #[serde(default, skip_serializing_if = "Vec::is_empty")]
379    pub tags: Vec<String>,
380}
381
382/// `SearchOpportunitiesResponseSchema` from the GoHighLevel OpenAPI spec.
383#[derive(Debug, Clone, Default, Serialize, Deserialize)]
384pub struct SearchOpportunitiesResponseSchema {
385    /// Unique identifier of the opportunity
386    #[serde(default, skip_serializing_if = "Option::is_none")]
387    pub id: Option<String>,
388    /// Name of the opportunity
389    #[serde(default, skip_serializing_if = "Option::is_none")]
390    pub name: Option<String>,
391    /// Monetary value of the opportunity
392    #[serde(
393        rename = "monetaryValue",
394        default,
395        skip_serializing_if = "Option::is_none"
396    )]
397    pub monetary_value: Option<f64>,
398    /// Identifier of the pipeline the opportunity belongs to
399    #[serde(
400        rename = "pipelineId",
401        default,
402        skip_serializing_if = "Option::is_none"
403    )]
404    pub pipeline_id: Option<String>,
405    /// Identifier of the pipeline stage the opportunity is in
406    #[serde(
407        rename = "pipelineStageId",
408        default,
409        skip_serializing_if = "Option::is_none"
410    )]
411    pub pipeline_stage_id: Option<String>,
412    /// Identifier of the user the opportunity is assigned to
413    #[serde(
414        rename = "assignedTo",
415        default,
416        skip_serializing_if = "Option::is_none"
417    )]
418    pub assigned_to: Option<String>,
419    /// Current status of the opportunity
420    #[serde(default, skip_serializing_if = "Option::is_none")]
421    pub status: Option<String>,
422    /// Source of the opportunity
423    #[serde(default, skip_serializing_if = "Option::is_none")]
424    pub source: Option<String>,
425    /// ISO 8601 timestamp of the last status change
426    #[serde(
427        rename = "lastStatusChangeAt",
428        default,
429        skip_serializing_if = "Option::is_none"
430    )]
431    pub last_status_change_at: Option<String>,
432    /// ISO 8601 timestamp of the last stage change
433    #[serde(
434        rename = "lastStageChangeAt",
435        default,
436        skip_serializing_if = "Option::is_none"
437    )]
438    pub last_stage_change_at: Option<String>,
439    /// ISO 8601 timestamp of the last action on the opportunity
440    #[serde(
441        rename = "lastActionDate",
442        default,
443        skip_serializing_if = "Option::is_none"
444    )]
445    pub last_action_date: Option<String>,
446    /// Index version of the opportunity record
447    #[serde(
448        rename = "indexVersion",
449        default,
450        skip_serializing_if = "Option::is_none"
451    )]
452    pub index_version: Option<String>,
453    /// ISO 8601 timestamp when the opportunity was created
454    #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")]
455    pub created_at: Option<String>,
456    /// ISO 8601 timestamp when the opportunity was last updated
457    #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")]
458    pub updated_at: Option<String>,
459    /// Expected close date for the forecast (YYYY-MM-DD)
460    #[serde(
461        rename = "forecastExpectedCloseDate",
462        default,
463        skip_serializing_if = "Option::is_none"
464    )]
465    pub forecast_expected_close_date: Option<String>,
466    /// Original forecast close date before any slippage (YYYY-MM-DD)
467    #[serde(
468        rename = "forecastOriginalCloseDate",
469        default,
470        skip_serializing_if = "Option::is_none"
471    )]
472    pub forecast_original_close_date: Option<String>,
473    /// Number of times the close date has slipped
474    #[serde(
475        rename = "forecastSlippageCount",
476        default,
477        skip_serializing_if = "Option::is_none"
478    )]
479    pub forecast_slippage_count: Option<f64>,
480    /// Total days the close date has slipped
481    #[serde(
482        rename = "forecastDaysSlipped",
483        default,
484        skip_serializing_if = "Option::is_none"
485    )]
486    pub forecast_days_slipped: Option<f64>,
487    /// ISO 8601 timestamp of the last close-date slip
488    #[serde(
489        rename = "forecastLastSlippedAt",
490        default,
491        skip_serializing_if = "Option::is_none"
492    )]
493    pub forecast_last_slipped_at: Option<String>,
494    /// Forecast win probability percentage (0–100)
495    #[serde(
496        rename = "forecastProbability",
497        default,
498        skip_serializing_if = "Option::is_none"
499    )]
500    pub forecast_probability: Option<f64>,
501    /// Effective win probability after stage and forecast adjustments (0–100)
502    #[serde(
503        rename = "effectiveProbability",
504        default,
505        skip_serializing_if = "Option::is_none"
506    )]
507    pub effective_probability: Option<f64>,
508    /// Identifier of the contact linked to the opportunity
509    #[serde(rename = "contactId", default, skip_serializing_if = "Option::is_none")]
510    pub contact_id: Option<String>,
511    /// Identifier of the location (sub-account) the opportunity belongs to
512    #[serde(
513        rename = "locationId",
514        default,
515        skip_serializing_if = "Option::is_none"
516    )]
517    pub location_id: Option<String>,
518    /// Contact details associated with the opportunity
519    #[serde(default, skip_serializing_if = "Option::is_none")]
520    pub contact: Option<SearchOpportunitiesContactResponseSchema>,
521    /// Notes attached to the opportunity
522    #[serde(default, skip_serializing_if = "Vec::is_empty")]
523    pub notes: Vec<Vec<serde_json::Value>>,
524    /// Tasks attached to the opportunity
525    #[serde(default, skip_serializing_if = "Vec::is_empty")]
526    pub tasks: Vec<Vec<serde_json::Value>>,
527    /// Calendar events attached to the opportunity
528    #[serde(
529        rename = "calendarEvents",
530        default,
531        skip_serializing_if = "Vec::is_empty"
532    )]
533    pub calendar_events: Vec<Vec<serde_json::Value>>,
534    /// Identifier of the lost reason if the opportunity was marked lost
535    #[serde(
536        rename = "lostReasonId",
537        default,
538        skip_serializing_if = "Option::is_none"
539    )]
540    pub lost_reason_id: Option<String>,
541    /// Custom fields associated with the opportunity
542    #[serde(
543        rename = "customFields",
544        default,
545        skip_serializing_if = "Vec::is_empty"
546    )]
547    pub custom_fields: Vec<CustomFieldResponseSchema>,
548    /// User IDs following this opportunity
549    #[serde(default, skip_serializing_if = "Vec::is_empty")]
550    pub followers: Vec<Vec<serde_json::Value>>,
551    /// External object identifier for integrations
552    #[serde(
553        rename = "externalObjectId",
554        default,
555        skip_serializing_if = "Option::is_none"
556    )]
557    pub external_object_id: Option<String>,
558}
559
560/// `SearchSuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
561#[derive(Debug, Clone, Default, Serialize, Deserialize)]
562pub struct SearchSuccessfulResponseDto {
563    /// List of opportunities matching the search criteria
564    #[serde(default, skip_serializing_if = "Vec::is_empty")]
565    pub opportunities: Vec<SearchOpportunitiesResponseSchema>,
566    /// Pagination metadata for the result set
567    #[serde(default, skip_serializing_if = "Option::is_none")]
568    pub meta: Option<SearchMetaResponseSchema>,
569    /// Aggregation results keyed by aggregation name
570    #[serde(default, skip_serializing_if = "Option::is_none")]
571    pub aggregations: Option<serde_json::Value>,
572}
573
574/// `StageAggregationResponseDto` from the GoHighLevel OpenAPI spec.
575#[derive(Debug, Clone, Default, Serialize, Deserialize)]
576pub struct StageAggregationResponseDto {
577    /// Identifier of the pipeline stage being aggregated
578    /// Required by the API.
579    #[serde(rename = "pipelineStageId")]
580    pub pipeline_stage_id: String,
581    /// Total number of opportunities in this stage
582    /// Required by the API.
583    #[serde(rename = "totalCount")]
584    pub total_count: f64,
585    /// Total monetary value of all opportunities in this stage
586    /// Required by the API.
587    #[serde(rename = "totalValue")]
588    pub total_value: f64,
589    /// Probability-weighted total value of opportunities in this stage
590    /// Required by the API.
591    #[serde(rename = "weightedValue")]
592    pub weighted_value: f64,
593    /// Total value of open opportunities in this stage
594    /// Required by the API.
595    #[serde(rename = "openValue")]
596    pub open_value: f64,
597    /// Probability-weighted value of open opportunities in this stage
598    /// Required by the API.
599    #[serde(rename = "openWeightedValue")]
600    pub open_weighted_value: f64,
601    /// Total value of won opportunities in this stage
602    /// Required by the API.
603    #[serde(rename = "wonValue")]
604    pub won_value: f64,
605}
606
607/// `UpdateOpportunityDtoV3` from the GoHighLevel OpenAPI spec.
608#[derive(Debug, Clone, Default, Serialize, Deserialize)]
609pub struct UpdateOpportunityDtoV3 {
610    /// pipeline Id
611    #[serde(
612        rename = "pipelineId",
613        default,
614        skip_serializing_if = "Option::is_none"
615    )]
616    pub pipeline_id: Option<String>,
617    /// Name of the opportunity
618    #[serde(default, skip_serializing_if = "Option::is_none")]
619    pub name: Option<String>,
620    /// Identifier of the pipeline stage
621    #[serde(
622        rename = "pipelineStageId",
623        default,
624        skip_serializing_if = "Option::is_none"
625    )]
626    pub pipeline_stage_id: Option<String>,
627    /// Current status of the opportunity
628    /// Allowed values: `open`, `won`, `lost`, `abandoned`, `all`.
629    #[serde(default, skip_serializing_if = "Option::is_none")]
630    pub status: Option<String>,
631    /// Monetary value of the opportunity
632    #[serde(
633        rename = "monetaryValue",
634        default,
635        skip_serializing_if = "Option::is_none"
636    )]
637    pub monetary_value: Option<f64>,
638    /// Expected close date. Supported formats: YYYY/MM/DD, MM/DD/YYYY, YYYY-MM-DD, MM-DD-YYYY,
639    /// YYYY.MM.DD, MM.DD.YYYY, or ISO 8601
640    #[serde(
641        rename = "forecastExpectedCloseDate",
642        default,
643        skip_serializing_if = "Option::is_none"
644    )]
645    pub forecast_expected_close_date: Option<String>,
646    /// Forecast probability
647    #[serde(
648        rename = "forecastProbability",
649        default,
650        skip_serializing_if = "Option::is_none"
651    )]
652    pub forecast_probability: Option<f64>,
653    /// Identifier of the user the opportunity is assigned to
654    #[serde(
655        rename = "assignedTo",
656        default,
657        skip_serializing_if = "Option::is_none"
658    )]
659    pub assigned_to: Option<String>,
660    /// Update custom fields to opportunities.
661    /// Multiple possible shapes in the spec; raw JSON.
662    #[serde(
663        rename = "customFields",
664        default,
665        skip_serializing_if = "Vec::is_empty"
666    )]
667    pub custom_fields: Vec<serde_json::Value>,
668}
669
670/// `UpdateStatusDto` from the GoHighLevel OpenAPI spec.
671#[derive(Debug, Clone, Default, Serialize, Deserialize)]
672pub struct UpdateStatusDto {
673    /// New status for the opportunity
674    /// Allowed values: `open`, `won`, `lost`, `abandoned`, `all`.
675    /// Required by the API.
676    pub status: String,
677    /// lost reason Id
678    #[serde(
679        rename = "lostReasonId",
680        default,
681        skip_serializing_if = "Option::is_none"
682    )]
683    pub lost_reason_id: Option<String>,
684}
685
686/// `UpsertOpportunityDto` from the GoHighLevel OpenAPI spec.
687#[derive(Debug, Clone, Default, Serialize, Deserialize)]
688pub struct UpsertOpportunityDto {
689    /// opportunityId
690    #[serde(default, skip_serializing_if = "Option::is_none")]
691    pub id: Option<String>,
692    /// pipeline Id
693    /// Required by the API.
694    #[serde(rename = "pipelineId")]
695    pub pipeline_id: String,
696    /// locationId
697    /// Required by the API.
698    #[serde(rename = "locationId")]
699    pub location_id: String,
700    /// contactId
701    /// Required by the API.
702    #[serde(default, skip_serializing_if = "Vec::is_empty")]
703    pub followers: Vec<String>,
704    /// isRemoveAllFollowers
705    /// Required by the API.
706    #[serde(rename = "isRemoveAllFollowers")]
707    pub is_remove_all_followers: bool,
708    /// followers action type
709    /// Allowed values: `add`, `remove`.
710    /// Required by the API.
711    #[serde(rename = "followersActionType")]
712    pub followers_action_type: String,
713    /// name
714    #[serde(default, skip_serializing_if = "Option::is_none")]
715    pub name: Option<String>,
716    /// Current status of the opportunity
717    /// Allowed values: `open`, `won`, `lost`, `abandoned`, `all`.
718    #[serde(default, skip_serializing_if = "Option::is_none")]
719    pub status: Option<String>,
720    /// Identifier of the pipeline stage
721    #[serde(
722        rename = "pipelineStageId",
723        default,
724        skip_serializing_if = "Option::is_none"
725    )]
726    pub pipeline_stage_id: Option<String>,
727    /// Monetary value of the opportunity
728    #[serde(
729        rename = "monetaryValue",
730        default,
731        skip_serializing_if = "Option::is_none"
732    )]
733    pub monetary_value: Option<serde_json::Value>,
734    /// Expected close date. Supported formats: YYYY/MM/DD, MM/DD/YYYY, YYYY-MM-DD, MM-DD-YYYY,
735    /// YYYY.MM.DD, MM.DD.YYYY, or ISO 8601
736    #[serde(
737        rename = "forecastExpectedCloseDate",
738        default,
739        skip_serializing_if = "Option::is_none"
740    )]
741    pub forecast_expected_close_date: Option<String>,
742    /// Forecast probability
743    #[serde(
744        rename = "forecastProbability",
745        default,
746        skip_serializing_if = "Option::is_none"
747    )]
748    pub forecast_probability: Option<f64>,
749    /// Identifier of the user the opportunity is assigned to
750    #[serde(
751        rename = "assignedTo",
752        default,
753        skip_serializing_if = "Option::is_none"
754    )]
755    pub assigned_to: Option<String>,
756    /// lost reason Id
757    #[serde(
758        rename = "lostReasonId",
759        default,
760        skip_serializing_if = "Option::is_none"
761    )]
762    pub lost_reason_id: Option<String>,
763}
764
765/// `UpsertOpportunitySuccessfulResponseDto` from the GoHighLevel OpenAPI spec.
766#[derive(Debug, Clone, Default, Serialize, Deserialize)]
767pub struct UpsertOpportunitySuccessfulResponseDto {
768    /// Updated / New Opportunity
769    /// Required by the API.
770    pub opportunity: serde_json::Value,
771    /// Indicates whether the opportunity was newly created (true) or updated (false)
772    /// Required by the API.
773    pub new: bool,
774}
775
776/// `customFieldsInputArraySchemaV3` from the GoHighLevel OpenAPI spec.
777#[derive(Debug, Clone, Default, Serialize, Deserialize)]
778pub struct CustomFieldsInputArraySchemaV3 {
779    /// Pass either `id` or `key` of custom field
780    /// Required by the API.
781    pub id: String,
782    /// Pass either `id` or `key` of custom field
783    #[serde(default, skip_serializing_if = "Option::is_none")]
784    pub key: Option<String>,
785    /// Value of the custom field
786    #[serde(rename = "fieldValue", default, skip_serializing_if = "Vec::is_empty")]
787    pub field_value: Vec<String>,
788}
789
790/// `customFieldsInputObjectSchemaV3` from the GoHighLevel OpenAPI spec.
791#[derive(Debug, Clone, Default, Serialize, Deserialize)]
792pub struct CustomFieldsInputObjectSchemaV3 {
793    /// Pass either `id` or `key` of custom field
794    /// Required by the API.
795    pub id: String,
796    /// Pass either `id` or `key` of custom field
797    #[serde(default, skip_serializing_if = "Option::is_none")]
798    pub key: Option<String>,
799    /// Value of the custom field
800    #[serde(
801        rename = "fieldValue",
802        default,
803        skip_serializing_if = "Option::is_none"
804    )]
805    pub field_value: Option<serde_json::Value>,
806}
807
808/// `customFieldsInputStringSchemaV3` from the GoHighLevel OpenAPI spec.
809#[derive(Debug, Clone, Default, Serialize, Deserialize)]
810pub struct CustomFieldsInputStringSchemaV3 {
811    /// Pass either `id` or `key` of custom field
812    #[serde(default, skip_serializing_if = "Option::is_none")]
813    pub id: Option<String>,
814    /// Pass either `id` or `key` of custom field
815    #[serde(default, skip_serializing_if = "Option::is_none")]
816    pub key: Option<String>,
817    /// Value of the custom field
818    #[serde(
819        rename = "fieldValue",
820        default,
821        skip_serializing_if = "Option::is_none"
822    )]
823    pub field_value: Option<String>,
824}